vendredi 30 mai 2014

Dynamically adding directive to element in Angular


Vote count:

0




I have a directive called "resizable" that adds functionality to an element to make it resizable.


I want to conditionally apply this directive to an element from a controller.


When I add this directive at run-time using attr, the attribute for the "resizable" directive is added, but the directive doesn't execute.


Here's an illustration: http://ift.tt/1hFSeSq


What I'm expecting is that when $('span').attr('resizable', ''); is called, the class funky should be added to the span. Why doesn't it?



asked 33 secs ago

Chris

8,297





Aucun commentaire:

Enregistrer un commentaire