Created
November 4, 2014 06:50
-
-
Save think2011/4e41ff84e0079f495f6a to your computer and use it in GitHub Desktop.
angular-显示html代码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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