My unique directive handles validation by the directive attribute value.
For example:
<input type="text" ng-my-validate="onlyletters" />
I am looking to dynamically change the value from onlyletters
to onlynumbers
, and I want the directive to adjust its validation behavior accordingly.
Any ideas on how to accomplish this?