ng-click still fires when div is (ng)disabled

后端 未结 5 1620
孤街浪徒
孤街浪徒 2021-02-03 20:15

Problem is that ng-click works on so event if cancelTicket === false it still fires ng-click. How can I stop that?

5条回答
  •  不要未来只要你来
    2021-02-03 20:38

    Event is triggered even if the div is disabled.

    You can avoid this by using lazy evaluation of expressions like isDisabled || action() so action would not be called if isDisabled is true.

    In your case it will be:

    ng-click="cancelTicket === false || CancelTicket(ticketPin)"
    

提交回复
热议问题