Compiling HTML in growl alert

222 Views Asked by At

I am trying to get HTML to compile in a growl alert. Here is my code:

var html = '<h3>' + rejection.config.method + ' '+ rejection.config.url + '</h3>' +
   '<hr><div>' +
   (_.isObject(rejection.data) ? ('<pre>' + JSON.stringify(rejection.data, null, 2) + '</pre>') : rejection.data) +
   '</div>' + '<a ng-click="reportError($event)"><i class="fa fa-bullhorn hoverable"></i>  Report this error</a>';
   growl.addErrorMessage(html,
   {
       enableHtml: true
   });
   $compile(html)($scope);

On the page the HTML looks like:

<div ng-bind-html="message.text" ng-switch-when="true" class="ng-scope ng-binding"><h3>GET services/link</h3><hr><div>null</div><a><i class="fa fa-bullhorn hoverable"></i>  Report this error</a></div>

The html should have the directive that I appended: "<a ng-click="reportError($event)" and it is not being added. Any ideas?

0

There are 0 best solutions below