title: Directive in ng-repeat not re-processing after updating the array
body: <p>I have a directive which converts certain strings into links (/) tags. I use this directive inside an ng-repeat to add links to text within a list of s. However, I refresh this data from a server which overwrites the array of the ng-repeat. The list gets updated in the DOM but the text no longer has links in it as it did when processed by the directive. How do I make the directive reprocess the text to add links?</p>
  
  <p>Relevant code below</p>
  
  <p>Controller HTML</p>
  
  <pre><code>&lt;div ng-repeat="post in posts track by $index" ng-if="!post.deleted"&gt;
      &lt;div  class="post wrap" ng-click="openSinglePostView(post, $index)" &gt;
          &lt;div class="post-desc" linkify="twitter" ng-bind="post.desc"&gt;&lt;/div&gt;         
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Controller JS</p>
  
  <pre><code>$scope.posts = [];
  
  function refresh(){ 
      $http.get(Constants.GET_POSTS_URL, {params : paramObject})
      .then(function (response){
          $scope.posts = [];
          for(var i = 0; i &lt; response.data.resultsArray.length; i++){
              var post = new PostFactory(response.data.resultsArray[i]);
              $scope.posts.push(post);
          }
      });
  }
  
  refresh();
  </code></pre>
  
  <p>Directive code</p>
  
  <pre><code>angular.module('linkify').directive('linkify', ['$filter', '$timeout', 'linkify', function ($filter, $timeout, linkify) {
      'use strict';
  
      return {
        //restrict: 'A',
        link: function (scope, element, attrs) {
          var type = attrs.linkify || 'normal';
          $timeout(function () { element.html(linkify[type](element.html()));
          });
  
        }
      };
    }]);
  </code></pre>
  
  <p>and for reference, the directive uses these filters and factories</p>
  
  <pre><code>angular.module('linkify')
    .filter('linkify', function (Constants) {
        'use strict';
  
        function linkify (_str, type) {
          if (!_str) {
            return;
          }
  
          var _text = _str.replace( /(?:https?\:\/\/|www\.)+(?![^\s]*?")([\w.,@?!^=%&amp;amp;:\/~+#-]*[\w@?!^=%&amp;amp;\/~+#-])?/ig, function(url) {
            var wrap = document.createElement('div');
            var anch = document.createElement('a');
            anch.href = url;
            anch.target = "_blank";
            anch.innerHTML = url;
            wrap.appendChild(anch);
            return wrap.innerHTML;
          });
  
          // bugfix
          if (!_text) {
            return '';
          }
  
          // Twitter
          if (type === 'twitter') {
            _text = _text.replace(/(|\s)*@([\u00C0-\u1FFF\w]+)/g, '$1&lt;a href="https://twitter.com/$2" target="_blank"&gt;@$2&lt;/a&gt;');
            _text = _text.replace(/(^|\s)*#([\u00C0-\u1FFF\w]+)/g, '$1&lt;a href="https://twitter.com/search?q=%23$2" target="_blank"&gt;#$2&lt;/a&gt;');
          }
  
          return _text;
        }
  
        //
        return function (text, type) {
          return linkify(text, type);
        };
    })
    .factory('linkify', ['$filter', function ($filter) {
      'use strict';
  
      function _linkifyAsType (type) {
        return function (str) {(type, str);
          return $filter('linkify')(str, type);
        };
      }
  
      return {
        twitter: _linkifyAsType('twitter'),
        icon: _linkifyAsType('icon'),
        normal: _linkifyAsType()
      };
    }])
  </code></pre>