![](/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.