Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
  
  <head>
    <meta charset="utf-8" />
    <script src="http://code.angularjs.org/1.0.2/angular.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular-sanitize.js"></script>
  </head>
  <body>
    
    <div id="container" ng-controller="MyCtl">
      <p>使用ng-bind-html-unsafe:</p>
      <div ng-bind-html-unsafe="someHtml"></div>
      <p>使用ng-bind:</p>
      <pre ng-bind="someHtml"></pre>
      <p>使用ng-bind-html:</p>
      <div ng-bind-html="someHtml"></div>
    </div>
  
  </body>
</html>
 
var app = angular.module('app', ['ngSanitize']);
app.controller('MyCtl', function($scope) {
  
    $scope.someHtml = '<img src="http://angularjs.org/img/AngularJS-large.png" />';  
 
  
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
annaismepro
0viewers