Skip to content

Instantly share code, notes, and snippets.

@think2011
Created November 4, 2014 06:50
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