This repository was archived by the owner on Oct 14, 2024. It is now read-only.
This repository was archived by the owner on Oct 14, 2024. It is now read-only.
[How-to] Jquery plugin - Add Swiped Carousel and other plugins #341
Closed
Description
Trying to use animation from inside of other functions in component by this.togglestates("goHide");
.
Tryed to use ViewEncapsulation.None also, or without it. No animation.
imports ...
@Component({
changeDetection: ChangeDetectionStrategy.Default,
encapsulation: ViewEncapsulation.Emulated,
selector: 'layer-discount',
templateUrl: './discount.component.html',
animations: [
trigger('visibilityChanged', [
state('shown' , style({ opacity: 1 })),
state('hidden', style({ opacity: 0 })),
transition('* => *', animate('.4s'))
])
]
})
export class DiscountComponent implements OnInit {
state: string ='show';
togglestates(STATE) {
if(STATE == 'goShow') {
setTimeout(function(){
this.state = 'show';
}, 800);
}
if(STATE == 'goHide') {
setTimeout(function(){
this.state = 'hidden';
}, 800);
}
}
}
html:
<div [@visibilityChanged]="state">
<h3>{{nigma.text}}</h3>
</div>
Metadata
Metadata
Assignees
Labels
No labels