0
Ich habe eine Eingabe die E-Mail zweimal,Wie customed Richtlinie und normale ng-Richtlinie läuft auch
jedoch zu bestätigen, wenn ich verwenden, um die check-email
Richtlinie und die required
Validierung funktioniert nicht mehr.
Irgendwelche Vorschläge? Ich möchte nicht, Benutzer dieses Feld leer
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;
})
}
}
})
Nun, ich sehe nicht 'required' hier .. – developer033
Warum Sie nicht einfach die Prüffunktion in der' ctrl. $ Validators'? – MMhunter