I have this field in app.component.ts
front: boolean = true;
And I am displaying this component template in app.component.html
<app-navbar></app-navbar>
That works, but I want to display that component (or not) based on the value of front, so i tried something like this which does not work:
<*ngIf="front" app-navbar></app-navbar>
How to achieve this?
Put ngIf after app-navbar(component name)
<app-navbar *ngIf="front"></app-navbar>
<app-navbar *ngIf="front"></app-navbar>
You have to open the tag (with app-nav) and then use the *ngIf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With