Angular 4.4.4 Angular Material 2.0.0-beta.12
I am trying to achieve a desktop layout where there is an Angular Material Toolbar at the top of the screen and the router-outlet content below filling the remaining screen height. I want the router-outlet content to fill the screen height so that I can set any child/grandchild components to have a height of 100% until such point that I want to provide a scrollbar.
I have gone back to basics to try and just get a div with a border to fill the space remaining below the Toolbar but I can't even get that to work. It looks as if the component replacing the router-outlet is the height of the full screen not taking into account the Toolbar above it.
My app.component is as follows:
<div id="app-component" style="height: 100%; border: 1px solid red;">
<!-- Application Toolbar -->
<mat-toolbar id="mat-toolbar" color="primary" style="margin: 0; padding: 0;">
<span style="padding-right: 16px;">Indigo</span>
<nav id="tabNavBar" #tabNavBar mat-tab-nav-bar>
<a mat-tab-link *ngFor="let tabNavLink of tabNavLinks"
[routerLink]="[tabNavLink.path]"
routerLinkActive
#rla="routerLinkActive"
[routerLinkActiveOptions]="{exact: true}"
[active]="rla.isActive"
(click)="onClickTab(tabNavLink)"
style="height: 64px;">
{{ tabNavLink.label }}
</a>
</nav>
</mat-toolbar>
<!-- Application Module Content -->
<router-outlet></router-outlet>
</div>
and the component targeted by the router-outlet is as follows:
<div style="width: 100%; height: 100%; margin: 0; padding: 0; border: 1px solid #4cff00;"></div>
The app.component fits perfectly. The child component sits immediately below the Toolbar but extends below the bottom of the window by the height of the toolbar causing a scrollbar to appear.
I have tried untold different approaches to this but would appreciate some advice on this frustratingly simple layout.