Adding a button in angular
template:`
<h1>{{ title }} ({{title.length}})</h1>
<input [(ngModel)]="title">
<h2 *ngIf="title.length>15"> the title is long!!!</h2>
<button (click)="click()">my button</button>
`
})
@Injectable()
export class AppComponent {
title = 'the title';
click() {
this.title += "button was clicked";
}
}
const apiUrl = '/dataApi/';
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com