Apply a directive conditionally

前端 未结 15 1939
别跟我提以往
别跟我提以往 2020-11-27 15:11

I am using Material 2 to add md-raised-button. I want to apply this directive only if certain condition becomes true.

For example:

<         


        
15条回答
  •  温柔的废话
    2020-11-27 15:44

    As others have also stated, directives can't be dynamically applied.

    However, if you just want to toggle md-button's style from flat to raised, then this

    
    

    would do the trick. Plunker

提交回复
热议问题