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