Enable/Disable Anchor Tags using AngularJS

后端 未结 11 1534
一整个雨季
一整个雨季 2020-12-01 05:45

How do I enable/disable anchor tags using the directive approach?

Example:

  1. while clicking on edit link, create & delete needs to be disabled or g
11条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 06:40

    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
    

提交回复
热议问题