sdApp.directive("sdVerNumber", function(){ return{ restrict: "A", replace: true, template: "<input type=\"text\" ng-pattern=\"/^([1-9]+[0-9]*|[0])([.]+[0-9]{0,2}|[.])?$/\" />" }; }); <input type="text" sd-ver-number class="sd-input-text sd-input-small" style="width:80px;" ng-model="addListData.m1" />
当输入内容错误的时候,对应状态的类ng-invalid-pattern没有相应改变。而直接把整个ng-pattern写在HTML上是可以正常工作的。请问这是为什么呢?
四季花海
相关分类