Search code examples
angularng-zorro-antd

How can I hide component when I use ng-zorro?


I use Angular 7 and ng-zorro, I want to hide sidebar when I click on the login button.

I have tried this "[(nzVisible)]="isVisible". But it is not working.

Uncaught Error: Template parse errors: Can't bind to 'nzVisible' since it isn't a known property of 'div'.enter code here


Solution

  • Simply add *ngIf="condition"

    working Example ng-zorro-antd-start

        <button nz-button *ngIf="false" nzType="primary" >Primary</button>
            <---hides component
        <button nz-button nzType="primary" >Primary</button>