结构-行为-样式-Angularjs-ngSanitize

简单点,上代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ngSanitize</title>
<script src="../jquery.1.9.1.min.js"></script>
<script src="../angular.js"></script>
<script src="angular-sanitize.js"></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
    <div class="container">
        <div class="row" ng-bind-html="content"></div>
    </div>
    <script>
        var app = angular.module('myApp',['ngSanitize']);
        app.controller('myCtrl',['$scope',function($scope){
            $scope.content = "<ul><li>小明</li><li>李雷</li><li>露西</li><li>海尔</li></ul>";
        }]);
    </script>
</body>
</html>
posted @ 2016-04-09 12:34  ChickenTang  阅读(183)  评论(0编辑  收藏  举报