I have a button on the nav menu that should show only on a specific component. I tried to put ngIf but it always return false. Any help?
I have a button on the nav menu that should show only on a specific component. I tried to put ngIf but it always return false. Any help?
you can add an input to your component.ts file like this:
@Input() showButton!: boolean;
then in your template:
<button *ngIf="showButton">...</button>
to use this component in your other templates:
<my-component [showButton]="true">show button</my-component>
or if you don't want to show it:
<my-component>Don't show button</my-component>