Skip to content

Instantly share code, notes, and snippets.

@think2011
Created November 4, 2014 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save think2011/4e41ff84e0079f495f6a to your computer and use it in GitHub Desktop.
Save think2011/4e41ff84e0079f495f6a to your computer and use it in GitHub Desktop.
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