如何仅在元素有效时触发模糊函数没有其他错误?
HTML
<input type="text" id="order" ng-model="order" name="order" class="form-control"
ng-pattern="/^[0-9]*$/" ng-minlength="9" maxlength="9"
required="" ng-blur="something()" />
JS
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.something=function(){
if($scope.routingNumber.$valid)
alert("yippie");
}
});
喜欢这个? http://plnkr.co/edit/oiGKFq?p=preview可能我误解了你的问题... – PSL 2014-10-01 21:51:54
你的问题解决了吗?你是否尝试过PSL活塞和我提供的答案? – apairet 2014-10-05 08:08:01
抱歉忘了更新它。是的,它被解决了:)谢谢 – future 2014-10-10 20:33:34