AngularJS check if form is valid in controller

前端 未结 4 1713
花落未央
花落未央 2020-12-02 11:39

I need to check if a form is valid in a controller.

View:

4条回答
  •  没有蜡笔的小新
    2020-12-02 12:20

    The BusinessCtrl is initialised before the createBusinessForm's FormController. Even if you have the ngController on the form won't work the way you wanted. You can't help this (you can create your ngControllerDirective, and try to trick the priority.) this is how angularjs works.

    See this plnkr for example: http://plnkr.co/edit/WYyu3raWQHkJ7XQzpDtY?p=preview

提交回复
热议问题