Skip to content

Instantly share code, notes, and snippets.

@AregSargsyan
Created May 30, 2020 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AregSargsyan/3df3ba1b6b3acf9c30f456495ae5d91b to your computer and use it in GitHub Desktop.
Save AregSargsyan/3df3ba1b6b3acf9c30f456495ae5d91b to your computer and use it in GitHub Desktop.
click event onpush
@Component({
template: `
<button (click)="increase()">Click</button>
{{count}}
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CounterComponent {
count = 0;
increase() {
this.count++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment