How do I enable/disable anchor tags using the directive approach?
Example:
My problem was slightly different: I have anchor tags that define an href
, and I want to use ng-disabled
to prevent the link from going anywhere when clicked. The solution is to un-set the href
when the link is disabled, like this:
Foo
In this case, ng-disabled
is only used for styling the element.
If you want to avoid using unofficial attributes, you'll need to style it yourself:
Foo