![](/img/trans.png)
[英]How to use the event ng-change directive in input text only when the length of the changed value is equal to x?
[英]Why the ng-change event not firing when the value field of input is changed from session
在我的jspx文件中,我这样写。 现在,value属性正在更改,我可以看到带有新值的文本框,但更改$值时不会触发ng-change,因为$ {sessionScope.counter}已更改。
<input type="text" ng-model="review.Rating" ng-change="change(review.Rating)" value="${sessionScope.counter}" />
PN:我已经加载了Angular属性,并且控制器中的其他功能正常运行。
如果您要更改“值”,则不会触发ngChange()。 就像onchange()一样。
当用户在输入字段中输入值时,ng-change将正确触发。 当用户键入几个字符并按选择一个值时,它不会触发
从angularjs看到输入[文本] https://docs.angularjs.org/api/ng/input/input%5Btext%5D
您可以在此处阅读ng-change的详细信息,例如“ 由于用户与输入元素的交互而导致输入更改时要执行的角度表达式 ”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.