Angularjs html文本显示


    
var app = angular.module('siteApp', []);
var con = app.controller("newsDetailController", ['$scope', '$http', '$sce', function ($scope, $http, $sce) {
    var vm = this;
    
    vm.data.content="你的HTML文本";
}]);

/*显示HTML文本*/
app.filter(
    'to_trusted',
    [
        '$sce', function ($sce) {
            return function (text) {
                return $sce.trustAsHtml(text);
            }
        }
    ]
)

你可能感兴趣的:(Angularjs html文本显示)