Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Last active September 28, 2020 12:07
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 BMU-Verlag/9614e5b61dbcd9f417f9a5969fc9b20f to your computer and use it in GitHub Desktop.
Save BMU-Verlag/9614e5b61dbcd9f417f9a5969fc9b20f to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.scss']
})
export class CounterComponent implements OnInit {
public counter = 0;
constructor() { }
ngOnInit(): void { }
public increment(): void {
this.counter += 1;
}
public decrement(): void {
this.counter -= 1;
}
public clearCounter(): void {
this.counter = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment