I recently created a custom validation directive and applied it to the form element like this:
<form myValidations>
app.directive('myValidations', function(){
return{
//require: 'ngModel', note its commented out
link: function(s,e,a,ctrl){//note the emphasis on the ctrl
}
}
});
But now I'm wondering how I can access ctrl.$parsers without using 'require: ngModel'.
Is there a way for me to locate an element and then call its ng-model within a function in order to retrieve an ng-model-controller and use $parsers from there?