I can't understand where is a bug here.
add.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'counter',
templateUrl: './add.component.html'
})
export class CounterComponent {
public currentCount = 0;
public incrementCounter() {
this.currentCount++;
}
}
add.component.html:
<h1>Counter</h1>
<p>This is a simple example of an Angular component.</p>
<p>Current count: <strong>{{ currentCount }}</strong></p>
<button (click)="incrementCounter()">Increment</button>
When I click on the button, nothing happens.