kendo ui, angular require validation for numeric text box

本小妞迷上赌 提交于 2019-12-09 20:19:35

问题


I am trying to use a kendo numeric text box with angular validation (ng-required) however I'm not able to get it working. The ng-required attribute on this element has no effect on the form validation status.

From my understanding, the reason why this doesn't work is because kendo numeric text box uses k-ng-model to store it's value, whereas the angular validation works only with ng-model.

Has anyone else seen this issue, are there any workarounds?


回答1:


I have found a workaround that involves using the kendo-numeric-text-box along with a hidden input field which makes use of ng-model.

<input data-kendo-numeric-text-box data-k-ng-model="numValue"/>
<input type="hidden" data-ng-model="numValue" data-ng-required="true" />


来源:https://stackoverflow.com/questions/26385761/kendo-ui-angular-require-validation-for-numeric-text-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!