Hide/Show material components
11,601
Your syntax is correct, and it should work. Check again the value of displayNoSignUp
in your component.
Related videos on Youtube
Author by
faizanjehangir
Updated on June 04, 2022Comments
-
faizanjehangir almost 2 years
I have a simple
mat-card
that I want to show/hide based on a value. However,*ngIf
directive does't seem to work on it.<mat-card *ngIf="displayNoSignUp">Simple card</mat-card>
Is there a way to do it using a directive on the material components? Or should it be wrapped inside an
html div
?-
Andres M about 6 yearsMany ways to do it. If you say *ngIf is not working, you could try [class.hidden]="displayNoSignup" and the set display:node in the hidden css class. This would hide it but the markup would still be there
-
-
faizanjehangir about 6 yearsExcuse thy lack of attention. The boolean values were reversed.