Angular 2: Using pipes with ngModel

后端 未结 1 1281
無奈伤痛
無奈伤痛 2020-12-16 21:12

I was using JQuery inputmask in one of my forms along with [(ngModel)], but for some reason they won\'t work together. Using either one by itself works perfectl

1条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 21:56

    [(ngModel)] is a short hand for [ngModel] and (ngModelChange). If you separate them it should work (it works for sure with the async pipe):

    [ngModel]="Amount | number: '1.2-2'" (ngModelChange)="updateAmount($event)"
    

    0 讨论(0)
提交回复
热议问题