AngularJS - Add attribute at runtime -


i'm working on angularjs app. i'm trying add autofocus attribute element @ runtime. reason want can set attribute on 1 of several elements. how add html attribute element via angularjs directive?

thank you!

you can use $set method on $compile.directive.attributes object. see documentation here. create new attribute angularjs recognize. remember use normalized (camelcase) version of attribute. can in link function of directive.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -