Getting [Object object] when using ng-model on a named form

后端 未结 4 1141
孤街浪徒
孤街浪徒 2021-02-14 07:12

If I have the following:

4条回答
  •  [愿得一人]
    2021-02-14 07:40

    Setting the name attribute on a form creates a scope object which is useful for validation but is not meant to be used for the ng-model attributes of inputs.

    If you use a separate scope variable for ng-model, it will work as you expect:

    
    
    
    

    Demo

提交回复
热议问题