I'm making an material design app angular2 and angular-material. I have a Header component which contains an md-toolbar
and an md-sidenav
within md-sidenav container
here is header.component.html:
<md-sidenav-container>
<md-sidenav #sidenav class="left-nav">
<md-nav-list>
<a md-list-item href="#"> Home </a>
<a md-list-item href="#"> About </a>
</md-nav-list>
</md-sidenav>
<md-toolbar color="primary">
<button md-icon-button (click)="sidenav.open()">
<md-icon>menu</md-icon>
</button>
<span> Trends </span>
</md-toolbar>
I have another stories component which uses *ngFor
to prints contents of a list. Here is my stories.component.html:
<div class="main-content">
<ol>
<li *ngFor="let story of stories; let i = index" class="post">
<span> {{ story.title }} </span>
</li>
</ol>
</div>
Now this works fine, but when the sidenav is opened its contained only with in the toolbar like this:
which is not what it want. So I use angular's
fullscreen
tag(?) in my sidenav-container:
<md-sidenav-container fullscreen>
This makes the sidenav look normal
but now the contents of
stories
component are no longer visible. The <li>
elements are still there(I can see them in Chrome dev tools) but they are not visible on the page.This is how my app.component.html is laid out:
<div id="wrapper">
<app-header></app-header>
<app-stories></app-stories>
</div>
I want to have a typical sidenav which covers my whole page and I also want the contents of my stories
component to be visible properly. I've tried moving around the md-toolbar
directive and bunch of other stuff but with no avail. How can this be fixed?