Created
September 17, 2019 17:33
-
-
Save eliraneliassy/96c6264e8b1bc9781f68c26ad7d01210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'app-timer-example', | |
template: ` | |
<div> | |
<app-timer *ngIf="alive"></app-timer> | |
</div> | |
<button (click)="destroy()" class="btn btn-danger">Destroy</button> | |
<button (click)="revive()" class="btn btn-primary">Revive</button> | |
`, | |
styleUrls: ['./timer-example.component.scss'] | |
}) | |
export class TimerExampleComponent { | |
public alive = true; | |
public destroy() { | |
this.alive = false; | |
} | |
public revive() { | |
this.alive = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment