Answering this question took a few more things to work for me.
My warning is as follows:
$scope.alerter.add({ type: "danger", msg: "<strong>ERROR:</strong> Unable to load credit care plan. Please contact your administrator." });
After doing the above, I started getting the following error:
Error: [$sce:unsafe]
So, I went ahead and made a filter to bypass the security of $ sce. I called the filter unsafe:
.filter('unsafe', function($sce) { return function(value) { if (!value) { return ''; } return $sce.trustAsHtml(value); }; })
Then use the filter as follows:
<alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)"> <span ng-bind-html="alert.msg | unsafe"></span> </alert>
My closeAlert function looked like this:
$scope.closeAlert = function(index) { $scope.alerts.splice(index, 1); };
Charles Naccio
source share