Right now, I am working with a project that has a web design that will contain a multiple view (multiple HTML files) on a single page. Though this is not a new design, but I cannot find a solution for this.
What I am trying is to access the other element from another view, I know that after the view has been rendered, they will be a single HTML and not multiple, but the Angular syntax doesn't let me go through with this.
This is the sample code.
Let say I do have 2 files with names layout.html, header.html
And also let say that the header has a selector named <app-header></app-header>
header.html
<div>
<button (click)="sideBar.toggle()">
<mat-icon>menu</mat-icon>
</button>
</div>
layout.html
<div>
<mat-toolbar>
<app-header></app-header> <!-- important part -->
</mat-toolbar>
<mat-sidenav-container>
<mat-sidenav #sideBar mode="side" opened> <!-- important part -->
<app-sidebar></app-sidebar>
</mat-sidenav>
<mat-sidenav-content>
Main content
</mat-sidenav-content>
</mat-sidenav-container>
</div>
So I'm trying to toggle the <mat-sidenav> using the button on my header, and I am referencing it with #sideBar
Is this possible?