<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="../angular.min.js"></script>
<style>
.red{ background:red;}
.yellow{ background:yellow;}
</style>
</head>
<body>
<div ng-app="myApp">
<div ng-controller="firstController">
<div ng-bind="text"></div>
<div ng-include="url"></div>
</div>
</div>
<script type="text/javascript">
var app = angular.module('myApp',[]);
app.controller('firstController',['$scope','$interval',function($scope,$interval){
//$scope.text = '<h1>hello</h1>';
$scope.text = 'hello';
$scope.url = 'test.html';
}]);
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="../angular.min.js"></script>
<style>
.red{ background:red;}
.yellow{ background:yellow;}
</style>
</head>
<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 ng-include src="tpl2"></div>
</div>
//以script方式引入模版
<script type="text/ng-template" id="tpl.html">
Content of the template.111111111111
</script>
<script type="text/ng-template" id="tpl2.html">
Content of the template.2222222222
</script>
</div>
<script type="text/javascript">
var app = angular.module('myApp',[]);
app.controller('firstController',['$scope','$interval',function($scope,$interval){
//$scope.text = '<h1>hello</h1>';
$scope.text = 'hello'; $scope.url = 'test.html'; $scope.tpl = 'tpl.html';
$scope.tpl2 = 'tpl2.html'; }]);
</script> </body>
</html>

angularjs1- ng-include的更多相关文章

  1. Part 16 ng include directive in AngularJS

    ng-include directive is used to embed an HTML page into another HTML page. This technique is extreme ...

  2. angular.js,IE7,8,9兼容性的处理

    转........... 这段时间详细了解了谷歌新出的MVVM框架angular.js,并直接在本人所从事的项目中使用了.但是使用新东西都是有风险的,这不,采用了新框架的页面IE7,8各种显示不出来… ...

  3. IE兼容性问题汇总【持续更新中】

    问题:IE8/9不支持Array.indexOf 解决方案 if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(elt ...

  4. AngularJS开发指南7:AngularJS本地化,国际化,以及兼容IE低版本浏览器

    AngularJS本地化,国际化 国际化,简写为i18n,指的是使产品快速适应不同语言和文化. 本地化,简称l10n,是指使产品在特定文化和语言市场中可用. 对开发者来说,国际化一个应用意味着将所有的 ...

  5. angularJs项目实战!02:前端的页面分解与组装

    自从上一篇文章到现在已经有将近一个月的时间,我将精力放在了前端页面分解与组装,和angularjs如何与jquery.bootstrap.D3等一系列其他类库结合使用的经验总结上.由于公司新招了一些员 ...

  6. Hex Dump In Many Programming Languages

    Hex Dump In Many Programming Languages See also: ArraySumInManyProgrammingLanguages, CounterInManyPr ...

  7. AngularJs学习笔记--IE Compatibility 兼容老版本IE

    原版地址:http://docs.angularjs.org/guide/ie Internet Explorer Compatibility 一.总括 这文章描述Internet Explorer( ...

  8. angularjs 手动启动

    谷歌推的javascript框架angulajs相当火热,由于新项目的缘故,最近一直看angularjs.在看的时候,一直有个疑问,angularjs 核心依赖于DI(依赖注入).常用的方法是在页面的 ...

  9. Angular js ie 7,8 兼容性

    Angularjs  官网有云: 1)在html 里面 ,有ng-app 的标签里需要定义个id ,id='ng-app'; 2)ie 7及以下版本需要json2.js或json3.js,主要用来解析 ...

  10. AngularJs1使用中出现错误 Error: [ng:areq]

    1.没有对应的控制器 2.有控制器但是路径没有配对

随机推荐

  1. git 本地项目推送至远程仓库

    1 在本地文件夹下创建一个 Git 仓库(如test目录下) git init 2 此时test文件夹即是你的maste主分支,你可以在改文件夹下写自己的项目 3 将test文件夹下的内容提交至暂存区 ...

  2. VM-安装MAC系统

    搜了下论坛没有这个教程,继续搬运一波,这次教的是用VM15安装Mac OS10.14懒人版VMware安装Windows和Linux比较类似,相对于今天要安装的MAC OS来说过程也比较简单.官方原版 ...

  3. NFine平台去掉平台介绍页面出现的一系列问题

    1.去掉平台介绍页面要做的操作:数值Index页面的下面两处内容 2.注释掉以上两处内容后出现的问题:•当打开多个页面后,最先打开的第一个页面(如下图1的位置)点击×号不能关闭页面:•当打开多个页面后 ...

  4. DB2大数据量优化查询解决方案

    利用DB2表分区的功能对大数据量的表进行分区,可以优化查询. 表分区介绍: 表分区是一种数据组织方案,它根据一列或多列中的值把表数据划分为多个称为数据分区 的存储对象. (我觉得表分区就类似于Wind ...

  5. android黑科技系列——手机端破解神器MT的内购VIP功能破解教程

    一.前言 在破解app的时候,我们现在几乎都是在PC端进行操作,但是之前bin神的MT管理器,可以在手机端直接破解,不过也有很大的局限性,但是对于一些简单的app破解没问题的.这个工具其实原理也很简单 ...

  6. 【Oracle】闪回技术

    1.闪回技术描述 2.数据库的准备: --undo表空间要设置成AUTO,设置合适的保存时间.undo表空间: SYS@ENMOEDU> show parameter undo NAME TYP ...

  7. Online ML那点事>-

    一:译自wiki:    KeyWord:标签反馈; Survey: online machine learning is a model of induction that learns one i ...

  8. 巧用Ajax的beforeSend提高用户体验

    jQuery是经常使用的一个开源js框架,其中的$.ajax请求中有一个beforeSend方法,用于在向服务器发送请求前执行一些动作. $.ajax({ beforeSend:function(){ ...

  9. 互联网汽车迎新成员 Alibaba YunOS Auto冠名2016世俱杯

    11月18日广州车展现场,阿里巴巴集团再次携手上汽集团连发三款搭载YunOS系统的互联网汽车,包括MG ZS.荣威eRX5和荣威i6.同时阿里巴巴集团YunOS总裁张春晖正式宣布互联网汽车业务全新升级 ...

  10. 05--C语言运算符优先级和ASCII码表