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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

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