if statement in ng-click

后端 未结 8 1029
鱼传尺愫
鱼传尺愫 2020-12-08 01:42

Is there a way to put a condition inside an ng-click? Here, I want that the form is not submitted if there are any form errors, but then I got a parse exception.

         


        
8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 02:06

    You can put conditionals inside tags. Try:

    ng-class="{true:'active',false:'disable'}[list_status=='show']"
    

提交回复
热议问题