[英]angularJS - ng-show - error
这就是我所拥有的。
<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>
我认为,NAME属性存在问题。 如果我在两者中使用orderid,则输入标记和以下错误条件都可以使用。 但我们使用Struts,我需要像xxxx.yyyy
这样的NAME属性
有没有办法在der ng-show
exprssion中使用这种语法?
感谢您的评论。
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;
}
};
在你的情况下,输入的control.$name === "order.id"
,所以这发生了什么:
form["order.id"] = control;
<span class="error"
ng-show="CustomerRegisterForm['order.id'].$error.required">Required!
</span>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.