title: How to use $mdTheming to apply theme to custom element
body: <p>I've been trying to figure out a way to use <code>$mdTheming</code> service provided by <code>angular-material</code> library to apply theme configured through <code>$mdThemingProvider</code>.</p>
  <h3>In Simpler terms:</h3>
  <p>Consider an element</p>
  <pre><code>&lt;div class=&quot;md-primary&quot; theme&gt;&lt;/div&gt;
  </code></pre>
  <p>The <code>theme</code> <strong>directive</strong> in this case has to <em><strong>inject</strong></em> the primary color configure to the theme.</p>
  <p>Below is the approach I tried to use, after going through <code>angular-material</code>'s code</p>
  <blockquote>
  <p><em>Just to see how they might have done it</em></p>
  </blockquote>
  <pre><code>export function ThemeDirective($mdTheming) {
   'ngInject';
   
   let directive = {
     restrict: 'A',
     link: (scope, element) =&gt; {
      $mdTheming(element);
     }
   };
  
    return directive
  }
  </code></pre>
  <p>The above code doesn't seem to be doing anything. I'm sure I've overlooked something. Need help.</p>