angulardomangular-materialstackblitzmat-sidenav

Contents of Angular Sidenav material container don't render


I am trying to use the angular material sidenav in my project but when I add it to the project it causes the entire page to be blank (white) and when I inspect the DOM nothing inside of mat-sidenav-container is rendered. I'm sure whatever I'm doing or not doing is very simple. I have used other angular materials in my project successfully already (namely the toolbar).

https://stackblitz.com/edit/angular-ivy-bcujpz?file=src%2Fapp%2Fhello.component.ts


Solution

  • You need to import BrowserAnimationsModule in your app module and it will render as expected.

    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';