I am using Material 2 to add md-raised-button
. I want to apply this directive only if certain condition becomes true.
For example:
<
I got another idea about what you could do.
You could store the html you want replaced in a variable as a string and then add / remove the directive from it as you wish, using the bypassSecurityTrustHtml
method of the DomSanitizer.
I doesn't result in a clean solution but at least you don't need to repeat the code.