码迷,mamicode.com
首页 > 其他好文 > 详细

Ng-include 例子

时间:2016-04-05 00:11:44      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:

<body>
    <div ng-app="myApp">
       <div ng-controller="firstController">
        <div ng-bind="text"></div>
        <div ng-include="url"></div>
        <div ng-include="tpl"></div>
       </div>
        <script type="text/ng-template" id="tpl.html">
            Content of the template

        </script>
    </div>
    <script type="text/javascript">
        var app = angular.module("myApp", []);

        app.controller(‘firstController‘, [‘$scope‘, function ($scope) {
          
            $scope.text = "Demo";
            // ng-include 用法
            $scope.url = "/Demo/Other";

            $scope.tpl = "tpl.html";       
        }]);
         
    </script>

</body>

 

Ng-include 例子

标签:

原文地址:http://www.cnblogs.com/MarchThree/p/5353259.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!