Angular 17 Click Event не стреляет?Html

Программисты Html
Anonymous
Angular 17 Click Event не стреляет?

Сообщение Anonymous »

Я начинаю с Angular, и у меня есть приведенный ниже код. < /p>

Код: Выделить всё

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
[/b] команда.


Подробнее здесь: https://stackoverflow.com/questions/784 ... not-firing

Вернуться в «Html»