Closed MELAS007 closed 7 years ago
When you click button show or hide element, you can do like this:
import {Component} from '@angular/core';
@Component({
template: ` <div *ngIf = "isShow"></div>
<button (click)="isShow()">show or hide</button>`
})
export class TestComponent {
private isShow = true;
constructor() {}
isShow() {
this.isShow = !this.isShow;
}
}
Thank you so much for your help! It is not a
but <lottie-animation-view [options]="lottieConfig" [width]="300" [height]="200" (animCreated)="handleAnimation($event)">@makan020518
You can use *ngIf directly
import {Component} from '@angular/core';
@Component({
template: ` <lottie-animation-view *ngIf="isShow"></lottie-animation-view>
<button (click)="isShow()">show or hide</button>`
})
export class TestPage {
private isShow = true;
constructor() {}
isShow() {
this.isShow = !this.isShow;
}
}
@MELAS007
Thanks for your help! @makan020518
@MELAS007 You can also use *ngIf
out of lottie-animation-view
, and handle the toggle logic in your own component, like the first example makan020518 provided :-)
@makan020518 Thank you Very much !
Dear,
I would like to know if you could help me to know how can I appear disappear the animation when i click on like button in ionic 3?
thanks in advance!