Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
angular-显示html代码
// js
app.controller('appCtrl', function ($sce) {
$scope.trustAsHtml = function (str) {
return $sce.trustAsHtml(str);
};
});
// html
<div ng-bind-html="trustAsHtml(item.content)"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment