title: ng-class does not trigger custom directive
body: <p>Ive created an <code>AngularJS</code> directive which will be triggered on all elements with the <em>classname</em> <code>.collapse</code>.</p>
  
  <p>But when I add this <em>class</em> using Angular's <code>ng-class</code>  directive, the custom <code>collapse</code> directive is not triggered.</p>
  
  <p><strong>Demonstration of my problem</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var app = angular.module('myApp', []);
  app.controller('myCtrl', function($scope) {
      $scope.welcome = "model";
      
      $scope.isTrue = function() {
        return true;
      }
  });
  
  app.directive("directive", function($compile) {
    return {
      restrict: 'C',
      scope: {
        model: '@'
      },
      link: function(scope, elem, attrs) {
        elem.css("background-color", "blue");
      }
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.directive {
    background-color: red;
    color: white;
    padding: 10px;
    margin-bottom: 10px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app="myApp" ng-controller="myCtrl"&gt;
    &lt;p&gt;Simple Angular app&lt;/p&gt;
    &lt;div class="directive"&gt;Make my background color blue using the directive&lt;/div&gt;
    &lt;div ng-class="isTrue() ? 'directive' : ''"&gt;Make my background color blue using the directive&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can I make the <code>directive</code> also trigger on <em>classes</em> which are added using <code>ng-class</code>?</p>