I have a pane system that includes three different forms inside my controller. Now, as I understand ng-include creates a childscope which makes it unavailable from the parent scope.
To solve the form data I passed the ng-model back in the function I run in ng-submit, but this is only 1 way.
In a normal situation I can do this:
HTML Form tag example
<form novalidate name="myForm" ng-submit="someFunction(form)">
HTML Form Field example
<input ng-model="form.first_name" name="first_name" type="text" pwtest required/>
Controller
$scope.myForm.first_name.$setValidity('required', false);
This works fine and my form data is return and I can send it on the way to my API and my field-state is also properly set.
Now to the problem..
HTML Form tag example
<form novalidate name="myForm" ng-submit="someFunction(form)">
HTML Form Field example
<input ng-model="form.first_name" name="first_name" type="text" pwtest required/>
Controller
$scope.myForm.first_name.$setValidity('required', false); <-- fails since myForm doesnt exist
This normaly works but now my form exists in a childscope and therefore myForm becomes undefined in my controller, as it should be of course since it doesnt exist in the scope.