I\'m using Angular 2 Material sidenav in my project this way:
You want to declare a ViewChild
in your controller that references the MdSidenav
inside your component, like this:
// Sidemenu
@ViewChild('start') sidenav: MdSidenav;
where start
is the name of the component you want to reference, in this case the sidenav.
Next you can call methods on that sidenav, like this.sidenav.toggle()
inside your controller's functions.
https://angular.io/docs/ts/latest/cookbook/component-communication.html#!#parent-to-view-child