title: Getting JS error using ng-bind-html and $sce.trustAsHtml()
body: <p>In my AngularJS controller I have this scope function:</p>
  
  <pre><code>$scope.show_description = function () {
      return ($scope.details.description.length) ? $sce.trustAsHtml(newlinesFilter($scope.details.description)) : 'edit to enter a description';
  };
  </code></pre>
  
  <p>The values of $scope.details.description initially has text with endlines, which the newlinesFilter replaces with BR.</p>
  
  <pre><code>app.filter('newlines', [function () {
      return function(text){
         return text.replace(/\n/g, '&lt;br/&gt;');
  }
  }]);
  </code></pre>
  
  <p>In my HTML:</p>
  
  <pre><code>&lt;span ng-bind-html="show_description()"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>Everything seems to work properly, yet I get this trace error in the console:</p>
  
  <pre><code>Error: [$sce:unsafe] http://errors.angularjs.org/1.2.16/$sce/unsafe
  at Error (native)
  at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:6:450
  at e (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:114:160)
  at getTrusted (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:115:443)
  at Object.e.(anonymous function) [as getTrustedHtml] (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:117:175)
  at Object.fn (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:188:375)
  at h.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:106:311)
  at h.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:109:287)
  at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:18:23
  at Object.d [as invoke] (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:34:265) angular.js:9778
  </code></pre>