为了账号安全,请及时绑定邮箱和手机立即绑定

angularjs ngblur不生效 onblur生效,为什么?

angularjs ngblur不生效 onblur生效,为什么?

缥缈止盈 2018-11-21 17:12:50
<input class="detail-reply"        id="replyInput"        type="text"        ng-model="$ctrl.replyString">这个input使用ng-blur是不会触发的,但是直接DOM绑定onblur事件是会触发,为什么?
查看完整描述

1 回答

?
慕姐4208626

TA贡献1852条经验 获得超7个赞

你用的是1还是2如果是2的话,可以
<input type="text" [(ngModel)]="myModel" (blur)="onBlurMethod()">

export class AppComponent { 

  myModel: any;

  constructor(){

    this.myModel = '123';

  }

  onBlurMethod(){

   alert(this.myModel) 

  }

}


查看完整回答
反对 回复 2018-12-28
  • 1 回答
  • 0 关注
  • 662 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信