ng-form directive can't have a dynamic name #7269
Description
Hello,
I have been using anglarjs quite a lot recently, and I have been working on a validation provider.
I need to get my validation logic to override angularjs's default validation.
For example, if a subform is pristine, then the form is invalid. I needed it the other way.
And another situation where the form is not pristine, but all fields are empty -> the parent form is valid...
After endless hours of development, my custom provider finally handles all this very well, and I finally get typahead + custom datepicker works well, with all my validations.
I am now in the situation where i need to add dynamically some ng-form, and access them by name or by object.
For example :
<form name="MainForm">
<div ng-form name="myForm">
//inputs
<button type=button ng-click="myValidator.submit(myForm)"
</div>
</form>
Where myForm represent the form with all the $pristine/$valid... properties that I can manipulate trough myValidator provider.
Now, If I get a dynamic name :
<form name="MainForm">
<div ng-form name="{{dynname}}">
//inputs
<button type=button ng-click="myValidator.submit( dynname ) "
</div>
</form>
There is no ways I can access this ng-form from my controller.
typeof $scope.MainForm[$scope.dynname] === 'undefined'