Reputation: 3
that's what I have.
<form action="/asvabo/ChangeCustomerRegister.do" method="post"
name="CustomerRegisterForm">
...
<input ... type="text" ... name="order.id" pattern="[0-9]*" required
ng-model="orderid" ng-trim="true"/>
<!-- Label for show that the input is required -->
<span class="error"
ng-show="CustomerRegisterForm.order.id.$error.required">Required!
</span>
....
</form>
I think, there is a problem with the NAME attribute. If i use orderid in both, the input-tag and the following error condition it works.
But we work with Struts and i need the NAME attribute like xxxx.yyyy
Is there a way to use this syntax in der ng-show
exprssion?
Thanks for comments.
Upvotes: 0
Views: 3502
Reputation: 32377
form.$addControl = function(control) {
// Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored
// and not added to the scope. Now we throw an error.
assertNotHasOwnProperty(control.$name, 'input');
controls.push(control);
if (control.$name) {
form[control.$name] = control;
}
};
In your case, the input's control.$name === "order.id"
, so this what happens:
form["order.id"] = control;
<span class="error"
ng-show="CustomerRegisterForm['order.id'].$error.required">Required!
</span>
Upvotes: 2