Issue is that only the first directive is working and other one is not. Provided below are the two directives. Both works fine when working alone.
.directive("restrictInvalidInput", function($rootScope, utils) {
retu {
restrict: "A",
require: "ngModel",
priority: 1,
link: function(scope, elem, attr, ctrl) {
var remove_invalid_chars = function() {
//blah blah
};
ctrl.$parsers.push(remove_invalid_chars);
}
}
})
.directive("validateUseame", function($rootScope, utils) {
retu {
restrict: "A",
require: "ngModel",
priority: 2,
link: function(scope, elem, attr, ctrl) {
var validate_useame = function(modelValue, viewValue) {
//blah blah
};
ctrl.$validators.valid_useame = validate_useame;
}
}
});
