I am using PrimeNG sidebar which slides right and routes to child component when we click on button, there in child component I have form template with button cancel. you can find sidebar template below.
sidebar.component.html
<p-sidebar [(visible)]="visibleSidebar2" position="right [baseZIndex]="10000">
<router-outlet name="createSidebar"></router-outlet>
</p-sidebar>
<a [routerLink]="[{ outlets: { createSidebar: 'create' } }]" class=" navigation__link" (click)="visibleSidebar2 = true"></a>
child.component.html
<a pButton class="btn btn-default" (click)="Cancel()">Cancel</a>
Now if I click on cancel button the sidebar needs to be hidden. I tried with some stackoverflow answers Angular 2 hide and show element previously posted but ended up with issue.
Any reply can be helpful. Thanks in advance.