最好是用ngModelChange

1.(change)

  1. //.html
  2. <input type="text" [(ngModel)]="msg" (change)="handleChange($event)">
  3. //.ts
  4. handleChange(e){
  5. console.log(e.target)
  6. }

2.(ngModelChange)

  • 只要ngModelChage中的内容改变时就会触发
  • (ngModelChange)要放在[(ngModel)]后面 ```javascript //.html

//.ts handleChange(){ console.log(1) } ```