Question: I've been coding a project in AngularJS to start learning the framework, currently I'm using the angular-material library and I'm trying to implement a sidenav similar to their demo here: <https://material.angularjs.org/#/demo/material.components.sidenav>

Unfortunately the $mdMedia('gt-md') call within the html below is always returning false (I'm opening it on a laptop screen so it should be true) but if I log the return from $mdMedia('gt-md') in the relevant angular controller it returns true. 

```
<md-sidenav class="md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')">

```

Can anyone shed any light on why I'm seeing this behaviour? I've been struggling with it for a number of days now.

Answer: 
After looking at the link posted by @ExpertSystem adding the $mdMedia service to the $rootscope allowed me to use $mdMedia directly from my HTML code.

The problem arose because as $mdMedia is a service it is not available to the view unless it is available on the scope.

Thanks all for your help!!
If you are using "angular-material": "0.8.1" or below in yr project. Change above code to this

```
<md-sidenav 
  class="md-sidenav-left md-whiteframe-z2" 
  md-component-id="left"
  md-is-locked-open="$media('gt-md')">

```