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

Popular posts from this blog

php - Autoloader issue not returning Class -

python - Getting next two indexes regardless of current index -

ruby - Prevent Custom Validation Error on Association -