title: ng-class not working on a custom directive with templateURL
body: <p>I have a directive that calls a template. Within the template i am using ng-class which adds a class on click. However, on click, this class is not getting added.</p>
  
  <p>Directive:</p>
  
  <pre><code>app.directive('myDirective', function () {
          return {
              restrict: 'E',
              scope: {
                  data: "="
              },
              templateUrl: 'home/user.html'
          }
      }
  );
  </code></pre>
  
  <p>home/user.html</p>
  
  <pre><code>&lt;label for="firstname"&gt;First Name&lt;/label&gt;
  &lt;input type="text" ng-model="data.input[0].value" required ng-class="{true : 'necessary'}[errorFirstName]" id="firstname"&gt;
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;div ng-controller="MyController"&gt;
  
      &lt;my-directive data="myData"&gt;&lt;/my-directive&gt;
  
      &lt;button ng-click="checkUsr()"&gt;Check user&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>MyController.js</p>
  
  <pre><code>app.controller('MyController', function($scope) {
  
      $scope.checkUsr = function() {
          $scope.errorFirstName = true;
      }
  });
  </code></pre>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>I've tried compilign too:</p>
  
  <pre><code>app.directive('myDirective', function ($compile) {
          return {
              restrict: 'E',
              scope: {
                  data: "="
              },
              templateUrl: 'home/user.html',
              link: function(scope, element, attrs) {
  
                  $compile(element.contents())(scope);
  
              }
          }
      }
  );
  </code></pre>