这个部分。求高手。看不懂
.directive('cp',function(){
var o = {};
o.strict = 'AE';
o.scope = {
ot : '=cp'
}
o.require = 'ngModel';
o.link = function(s,e,a,c){
c.$validators.cp = function(v){
return v == s.ot;
}
s.$watch('ott',function(){
c.$validate();
})
}
return o;
})
.directive('cp',function(){
var o = {};
o.strict = 'AE';
o.scope = {
ot : '=cp'
}
o.require = 'ngModel';
o.link = function(s,e,a,c){
c.$validators.cp = function(v){
return v == s.ot;
}
s.$watch('ott',function(){
c.$validate();
})
}
return o;
})
2016-10-16
最赞回答 / qq_爱妾别闹_0
ng-valid: 验证通过ng-invalid: 验证失败ng-valid-[key]: 由$setValidity添加的所有验证通过的值ng-invalid-[key]: 由$setValidity添加的所有验证失败的值ng-pristine: 控件为初始状态ng-dirty: 控件输入值已变更ng-touched: 控件已失去焦点ng-untouched: 控件未失去焦点ng-pending: 任何为满足$asyncValidators的情况
2016-10-04