ngModel changes, ngModelChange is not called

前端 未结 3 633
星月不相逢
星月不相逢 2021-01-18 01:26

The model gets changed b

3条回答
  •  轮回少年
    2021-01-18 01:37

    This needs to be more like a comment, but putting it as an answer to make it more visible. I got the same error, but unfortunately the above answer did not work. There was also an error in the console which I ignored earlier ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone' in ngModelOptions. Fixing this issue caused the problem to be fixed.

    In a nutshell what I did was adding an additional attribute called name to the input.

    
    

提交回复
热议问题