0
を通関ディレクティブと通常のNG-指令を実行する私は二回、電子メールを確認するための入力を持っている、はどのようにも
しかし、もはや機能していません。
提案がありますか?私は、ユーザーが
HTML
<input type="text"
id="confirm_email_booking"
name="confirm_email_booking"
class="form-control"
check-email
ng-model="payment_contact.confirm_email_booking"
/>
JS、このフィールドを空白保持したくない
app.directive('checkEmail', function() {
return {
require: 'ngModel',
link: function(scope, elm, attrs, ctrl) {
ctrl.$parsers.unshift(function(viewValue, $scope) {
var notMatch = (viewValue != scope.form.email_booking.$viewValue)
ctrl.$setValidity('notMatch', !notMatch)
return notMatch;
})
}
}
})
まあ、私は – developer033
は、なぜあなたは、単にCTRL 'に検証関数を追加しない...ここに' required'を見ることができません。$のvalidators'を? – MMhunter