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.有控制器但是路径没有配对
随机推荐
- QlikSense系列(3)——QlikSense建立数据模型
QlikSense管理数据在帮助中写的比较清楚 https://help.qlik.com/zh-CN/sense/3.1/Subsystems/Hub/Content/LoadData/load-d ...
- [Offer收割]编程练习赛38
漏写的数字 #pragma comment(linker, "/STACK:102400000,102400000") #include<stdio.h> #inclu ...
- JDK和Cglib实现动态代理实例及优缺点分析
Spring AOP使用的核心技术是动态代理,说到动态代理就不得不和设计模式中的代理模式联系起来,通过代理模式我们可以对目标类进行功能增强,在某个方法的执行前后增加一些操作,例如计算方法执行效率.打印 ...
- 多项式拟合的cpp实现
当我们拥有一组散点图数据时,通常更愿意看到其走势. 对现有数据进行拟合,并输出拟合优度是常用的方法之一. 拟合结果正确性的验证,可以使用excel自带的功能. 下面是c++代码的实现: #ifndef ...
- TortoiseSvn问题研究(一)
问题描述 今天在工作中遇到一个SVN方面的问题,牵扯出使用SVN这一段时间的一系列问题. 具体来说,是这样的: 上周五有上线分支,自己的分支需要merge: 很多项目小组都在开发这个项目,再往前好像也 ...
- html form表单追加input元素后在提交
form.append(input); //input为对象 (设置name和val有效) $("#form1").submit();//提交事件
- android学习路线总结
感谢安辉作者,学习路线 https://www.cnblogs.com/yishaochu/p/5436094.html https://www.cnblogs.com/jycboy/p/60666 ...
- centos7的编译安装php5.3 (针对老系统必须安装php5.3才能运行)
大家都知道,centos6以上yum都自带5.4以上的php版本,可是一些老系统必须安装 php-5.3该怎么办呢.下面我来教大家一步步编译安装.看看我踩过的坑. 第一步: 网上下载php5.3的源码 ...
- Nginx负载均衡health_check分析
在Nginx负载均衡中,我们很难保证说每一台应用服务器都能一直正常的运行下去.但是我们可以通过设置Nginx来检测这些应用服务器,检测这些服务器当中不能访问的. Nginx的检测方式分为两种,一种是被 ...
- 取得Linux系统的各种统计信息
本文基于Linux 2.6.x内核 一.取得CPU信息(相关文件/proc/stat) 在一个系统中的/proct/stat文件内容如下 $ cat /proc/stat cpu 1039426 17 ...