I am utilizing the PrimeNG sidebar feature that slides to the right and navigates to a child component upon clicking a button. Within the child component, there is a form template with a cancel button. The template for the sidebar can be found 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>
If I click on the cancel button, the sidebar should be hidden. I have attempted solutions from various Stack Overflow posts such as Angular 2 hide and show element . However, I encountered some issues in implementing them.
Any assistance would be greatly appreciated. Thank you in advance.