<div ng-app="module" ng-controller="ctrl"> {{data}} <hr> <div ng-bind-html="data"></div> <hr> <div ng-bind-html="title | trustHtml"></div> </div> <script> var m = angular.module('module', []); m.filter('trustHtml',['$sce',function($sce){ return function(data){ return $sce.trustAsHtml(data); } }]) m.controller('ctrl', ['$scope', '$sce', function ($scope, $sce) { $scope.data = $sce.trustAsHtml('<h1 style="color:red;">angularJs</h1>'); $scope.title = '<h3 style="color:red;">angularJs</h3>'; }]); </script>