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
Post a Comment