For example say I have a sidenav and need to add different items to it based on the page that the user is on. Can I do that with a portal?
This is my side nav. I was thinking depending on the page the developer can pass in a component and it shows on the {{ComponentGoesHere}} portion of the side nav
<md-sidenav-container fullscreen>
<md-sidenav #sidenav mode="push" class="app-sidenav">
<md-toolbar color="primary">
<span style="flex: 1 1 auto"></span>
<button md-icon-button (click)="sidenav.toggle()" class="md-icon-button sidenav-toggle-button" [hidden]="!sidenav.opened">
<md-icon aria-label="Menu" class="material-icons">close</md-icon>
</button>
</md-toolbar>
<div>
**{{ComponentGoesHERE}}**
</div>
<h2>Navigation</h2>
<md-nav-list>
<a md-list-item class="sidenav-link" [routerLink]="['/comp1']" (click)="sidenav.toggle()">
<md-icon md-list-icon>account_balance</md-icon>
<span class="title" md-line>comp1</span>
<span md-line class="secondary">test</span>
</a>
<a md-list-item class="sidenav-link" [routerLink]="['/comp2']" (click)="sidenav.toggle()">
<md-icon md-list-icon>android</md-icon>
<span class="title" md-line>comp2</span>
<span md-line class="secondary">test</span>
</a>
</md-nav-list>
</md-sidenav>
<md-toolbar id="appToolbar" color="primary">
<button md-icon-button (click)="sidenav.toggle()" class="md-icon-button sidenav-toggle-button" [hidden]="sidenav.opened">
<md-icon aria-label="Menu" class="material-icons">menu</md-icon>
</button>
<h1>
<a class="title-link">My Navigation Bar</a>
</h1>
<span style="flex: 1 1 auto"></span>
<button id="button-logout" md-button>Log Out</button>
</md-toolbar>
<router-outlet></router-outlet>
</md-sidenav-container>
EDIT: Since the sidenav is global (exists in app component) is there a way to see if there is a portal component on a particular page load?
Lets say i navigate to a page called "reports". The portal see that reports has a report portal component and loads it to the side nav.
Then i navigate to transactions. The portal sees that transactions has a search function portal component and loads it.
Then i go to a settings page and the portal sees there is no component so it hides itself.
I was hoping it was possible this way so that I only have to reference these components as needed.