Remove or add class in Angular

前端 未结 5 2040
感动是毒
感动是毒 2021-02-14 08:37

I have a list and the plugin (dragula) I used, adds certain CSS class on certain action. I am using Angular 5. I want to find out the presence of certain class (

5条回答
  •  情话喂你
    2021-02-14 09:26

    The Best and easiest way is : -

    If student is null then dissabled else not. Use this in button attribute. If you are using bootstrap theme

    [ngClass]="{disabled: (students === null) ? true : false}"
    

提交回复
热议问题