angularjs - Dynamically added attributes don't initialise -
i trying dynamically add attributes html elements generated , compiled in ng-repeat
statement.
i using following directive on input elements.
.directive('ngloading', function($compile) { return function(scope, element, attrs) { scope.$watch(attrs.ngloading, function() { element.attr('ng-required', true); element.attr('ng-pattern', '/^[0-9]+$/'); element.removeattr('ng-loading'); $compile(element)(scope); }); }; });
the problem seeing in fact add attribute, ng-required="true"
etc. doesn't initialized browser , validation doesn't kick in.
Comments
Post a Comment