angularjs - Angular directive for form elements -


i want create directive used form elements input,textarea,select...

my code:

app.directive('input', function() {     return {         restrict: 'e',         priority: -1000,         require: '^?required',         link: function (scope, element, attrs, ctrl) {              element.on('focus', function (e) {                 element.addclass('validate');             });          }     }; }); 

when try use common directive doesn't work don't have idea why...

<input common-directive type="text" name="name" placeholder="firstname" ng-model="profile.name" ng-minlength="2" required /> 


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -