Skip to content

Instantly share code, notes, and snippets.

@eliraneliassy
Created September 17, 2019 17:33
Show Gist options
  • Save eliraneliassy/96c6264e8b1bc9781f68c26ad7d01210 to your computer and use it in GitHub Desktop.
Save eliraneliassy/96c6264e8b1bc9781f68c26ad7d01210 to your computer and use it in GitHub Desktop.
@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