export class AppComponent { hi = 'hi how are you'; url = 'http://www.google.com'; title = 'i\'m title'; click() { this.hi = 'i click'; } selectchange(value: string) { this.hi = value; } checked(checked: boolean) { if (checked) { this.hi = 'checked'; } else { this.hi = 'not check'; } } }到app.component.html裡新增三個html來對應剛剛的function
===============================================================
經過上述範例,在實作後其實不難懂,可能不太瞭解有哪些屬性可使用console.log($event);
以上內容若有不足或侵權請告知將立即處理