Angular 2 change event - model changes

后端 未结 4 1672
有刺的猬
有刺的猬 2020-12-03 04:24

How can I get the values after a model has changed? The (change) event does fire before the model change. I do not want to use event.target.value

4条回答
  •  旧巷少年郎
    2020-12-03 04:43

    That's a known issue. Currently you have to use a workaround like shown in your question.

    This is working as intended. When the change event is emitted ngModelChange (the (...) part of [(ngModel)] hasn't updated the bound model yet:

    
    

    See also

    • https://github.com/angular/angular/issues/3406,
    • https://github.com/angular/angular/issues/6311

提交回复
热议问题