code: function watchMedia() {
        for (var mediaName in $mdConstant.MEDIA) {
          $mdMedia(mediaName); // initialize
          $mdMedia.getQuery($mdConstant.MEDIA[mediaName])
              .addListener(invalidateLayout);
        }
        return $mdMedia.watchResponsiveAttributes(
            ['md-cols', 'md-row-height', 'md-gutter'], attrs, layoutIfMediaMatch);
      }
docs: Watches for changes in media, invalidating layout as necessary.