Skip to content Skip to sidebar Skip to footer

Attribute Of Label Not Working In Angular Directive?

I am trying to learn how to work with angular directives and so far with success. I have only one minor issue I cannot figure out. In my directive I got a for attribute set on the

Solution 1:

Your "wrapper" has the same id too and it is not good. You can remove it in a link function, this way:

link: function(scope,el,attrs){
     el.removeAttr("id");
 }

Working: http://jsfiddle.net/cherniv/5u4Xp/

Or in compile function (thanks to Florent):

compile: function(el){
     el.removeAttr("id")
 }

Example: http://jsfiddle.net/cherniv/7GG6k/

Post a Comment for "Attribute Of Label Not Working In Angular Directive?"