I created a directive that displays a message, plus it can render any html message with angular attributes maybe, it might include buttons, anchor tags (with ng-clicks attribute) and so on..
index.html:
<ir-error-panel status="status"></ir-error-panel> irErrorPanel.tpl.html:
<div > THE MESSAGE IS:<BR> <div ng-bind-html="textHtmlSafe"></div> </BR> </div> irErrorPanel.js:
angular.module('ng-iridize-common.directives').directive('irErrorPanel', ['$sce', function($sce) { return { restrict: 'E', templateUrl: 'irErrorPanel.tpl.html', controller: ['$scope', '$log', function($scope, $log) { var _this = this; _this.applyMessageText = function applyMessageText() { $scope.textHtmlSafe = $scope.status && $scope.status.text ? $sce.trustAsHtml($scope.status.text) : ""; }; _this.applyMessageText(); $scope.$watch("status.text", function(newValue, oldValue) { if (newValue === oldValue) { return; } if (!newValue) { $scope.textHtmlSafe = ""; return; } _this.applyMessageText(); }); }], link: function(scope, iElement, iAttrs, ctrl) { //call service and check box status. scope.$watch("status.text", function(value) { $compile(iElement.contents())(scope); }) } } }]); when for example the status is : "click !", it renders perfectly fine, but ng-click doesn't fire anything.