Код: Выделить всё
app.component.htmlКод: Выделить всё
{{ title }}
Count is: {{ count }}
Button
< /code>
app.component.tsКод: Выделить всё
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.css',
})
export class AppComponent {
title = 'Angular Learn';
count = 1;
updateCount() {
this.count++;
}
myFunction() {
console.log('Title Clicked');
alert('Title Clicked');
}
}
< /code>
The functions defined in the TS file are not firing. No idea what is wrong here. I created my app using the [b]npm init @angular angular-learnПодробнее здесь: https://stackoverflow.com/questions/784 ... not-firing