How can I set a form contained inside a ng-include to be prestine?

后端 未结 4 1094
轻奢々
轻奢々 2021-01-07 23:33

I have the following code:

4条回答
  •  走了就别回头了
    2021-01-07 23:51

    Do not break the rules :) Just define the variable (empty object) in the controller and use it while defining your form. Since angular JS uses scope prototypes under the hood, when form will try to access the inner scope (to bootstrap the variable), it will first go via scope chain and try to find the same variable in the parent's scope.

    
    

    Link for reference http://blog.152.org/2014/07/angular-form-element-not-attaching-to.html

提交回复
热议问题