angularjs1- ng-include
<!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的更多相关文章
- 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 ...
- angular.js,IE7,8,9兼容性的处理
转........... 这段时间详细了解了谷歌新出的MVVM框架angular.js,并直接在本人所从事的项目中使用了.但是使用新东西都是有风险的,这不,采用了新框架的页面IE7,8各种显示不出来… ...
- IE兼容性问题汇总【持续更新中】
问题:IE8/9不支持Array.indexOf 解决方案 if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(elt ...
- AngularJS开发指南7:AngularJS本地化,国际化,以及兼容IE低版本浏览器
AngularJS本地化,国际化 国际化,简写为i18n,指的是使产品快速适应不同语言和文化. 本地化,简称l10n,是指使产品在特定文化和语言市场中可用. 对开发者来说,国际化一个应用意味着将所有的 ...
- angularJs项目实战!02:前端的页面分解与组装
自从上一篇文章到现在已经有将近一个月的时间,我将精力放在了前端页面分解与组装,和angularjs如何与jquery.bootstrap.D3等一系列其他类库结合使用的经验总结上.由于公司新招了一些员 ...
- Hex Dump In Many Programming Languages
Hex Dump In Many Programming Languages See also: ArraySumInManyProgrammingLanguages, CounterInManyPr ...
- AngularJs学习笔记--IE Compatibility 兼容老版本IE
原版地址:http://docs.angularjs.org/guide/ie Internet Explorer Compatibility 一.总括 这文章描述Internet Explorer( ...
- angularjs 手动启动
谷歌推的javascript框架angulajs相当火热,由于新项目的缘故,最近一直看angularjs.在看的时候,一直有个疑问,angularjs 核心依赖于DI(依赖注入).常用的方法是在页面的 ...
- Angular js ie 7,8 兼容性
Angularjs 官网有云: 1)在html 里面 ,有ng-app 的标签里需要定义个id ,id='ng-app'; 2)ie 7及以下版本需要json2.js或json3.js,主要用来解析 ...
- AngularJs1使用中出现错误 Error: [ng:areq]
1.没有对应的控制器 2.有控制器但是路径没有配对
随机推荐
- arg max f(x) 含义
y = f(x) 是一般常见的函数式,如果给定一个x值,f(x)函数式会赋一个值給y. y = max f(x) 代表:y 是f(x)函式所有的值中最大的output. y = arg max f(x ...
- 用 Swift 开发一个 TODO 应用
背景 相信不少 iOS 程序员对于 Swift 依旧持以观望的态度,一来是这小家伙刚出来没几天,本身还处于完善的阶段:二来是学习的成本较高,看完官方文档怎么也要个几天的时间:三来是反正最近几年很难在工 ...
- WinForm和数据库的连接
有几天没有写东西,今天来写点关于数据库的东西. 第一步:现在你自己的SQL Server数据库中创建一个新的数据库test,然后在里面新建一张表tb_user,在这张表中添加几个字段并为它赋值,具体结 ...
- bind()函数的作用
bind()函数是Function原型上的一个属性,当某个函数调用此方法时,可以通过向bind()函数传入执行对象和调用bind的函数的参数来改变函数的执行对象 /*问题:改变func执行环境,使之输 ...
- 文档控件NTKO OFFICE 详细使用说明之预览PDF文件(禁止打印、下载、另存为、防抓包下载)
1.在线预览PDF文件(禁止打印.下载.复制.另存为) (1) 运行环境 ① 浏览器:支持IE7-IE11(平台版本还支持Chrome和Firefox) ② IE工具栏-Internet 选项:将ww ...
- java8-2-Lambda表达式
java8的lambda表达式:使得代码更加紧凑:修改方法的能力:更好的支持多核处理(并行处理函数和filter\map\reduce) 例子1: java7中,list集合排序: public st ...
- python课程设计笔记(五) ----Resuests+BeautifulSoup (爬虫入门)
官方参考文档(中文版): requests:http://docs.python-requests.org/zh_CN/latest/user/quickstart.html beautifulsou ...
- Linux od与hexdump命令
od命令:以指定格式输出文件内容常用格式:od -Ax -tx1 filename直接格式:od filename 等价 od -o filename语法:od [-abcdfsiloxv] [-An ...
- QS之vsim
vsim - The vsim command invokes the VSIM simulator -L <library_name> … (optional) Specifies th ...
- ionic3、Angular4 定时器的使用
// 声明变量 applicationInterval:any; // 定时器 // 使用定时器,每秒执行一次 ionViewDidEnter(){ let that = this; let appl ...