Mastering Web Application Development with AngularJS 读书笔记(一)
第一章笔记 (一)
一、PS:运行时配置IIS
<html>
<head>
<script src="angular.js"></script>
</head>
<body ng-app ng-init="name = 'World'">
<h1>Hello, {{name}}!</h1>
</body>
</html>
<body ng-app ng-init="name='World'">
Say hello to:<input type="text" ng-model="name" />
<h1>hello,{{name}}</h1>
</body>
<script type="text/javascript" src="angular.js"></script>
<script type="text/javascript">
var HelloCtrl = function ($scope) {
$scope.name = 'World';
$scope.getName = function() {
return $scope.name;
};
}
</script>
<body ng-app >
<div ng-controller="HelloCtrl">
Say hello to: <input type="text" ng-model="name"><br>
<h1>Hello, {{name}}!</h1>
<h2>The same,{{getName()}}</h2>
</div>
</body>
<script type="text/javascript">
var WorldCtrl = function ($scope) {
$scope.population = 7000;
$scope.countries = [
{name:'France', population:63.1},
{name:'United Kingdom', population:61.8}
];
}
</script>
<body ng-app >
<div ng-controller="WorldCtrl" class="container">
<ul>
<li ng-repeat="country in countries">
{{country.name}} has population of{{country.population}}millions
</li>
</ul>
</div>
</body>
$scope.worldsPercentage = function (countryPopulation) {
return (countryPopulation / $scope.population)*100;
}
<li ng-repeat="country in countries">
{{country.name}} has population of{{country.population}}millions,
{{worldsPercentage(country.population)}} % of the World's population
</li>
var HelloCtrl = function ($scope) {
};
<body ng-app ng-init="name='World'">
<h1>Hello, {{name}}</h1>
<div ng-controller="HelloCtrl">
Say hello to: <input type="text" ng-model="name">
<h2>Hello, {{name}}!</h2>
</div>
</body>
<body ng-app ng-init="thing={name:'World'}">
<h1>Hello, {{thing.name}}</h1>
<div ng-controller="HelloCtrl">
Say hello to: <input type="text" ng-model="thing.name">
<h2>Hello, {{thing.name}}!</h2>
</div>
</body>
Mastering Web Application Development with AngularJS 读书笔记(一)的更多相关文章
- Mastering Web Application Development with AngularJS 读书笔记-前记
学习AngularJS的笔记,这个是英文版的,有些地方翻译的很随意,做的笔记不是很详细,用来自勉.觉得写下来要比看能理解的更深入点.有理解不对的地方还请前辈们纠正! 一.关于<Mastering ...
- Mastering Web Application Development with AngularJS 读书笔记(三)
第一章笔记 (三) 一.Factories factory 方法是创建对象的另一种方式,与service相比更灵活,因为可以注册可任何任意对象创造功能.例如: myMod.factory('notif ...
- Mastering Web Application Development with AngularJS 读书笔记(二)
第一章笔记 (二) 一.scopes的层级和事件系统(the eventing system) 在层级中管理的scopes可以被用做事件总线.AngularJS 允许我们去传播已经命名的事件用一种有效 ...
- WEB Application Development Integrator : 应用设置
1.1. 系统安装 应用 Oracle EBS WEB Application Development Integrator WEB ADI在Oracle EBS 11.5.10.* 版本 ...
- 精通AngularJS 读书笔记(2)
AngularJS 速成 视图 因为AngularJS 依靠浏览器去解析模板,所以要保证模板是有效的HTML.尤其要小心闭合号HTML标签(未闭合好的标签不会产生任何错误信息,但会让视图不能正确渲染) ...
- 精通AngularJS 读书笔记(1)
邂逅AngularJS AngularJS是采用JavaScript语言编写的客户端MVC框架,帮助开发者编写现代化的单页面应用.尤其适合编写有大量CURD操作的,具有AJAX风格的富客户端应用. 使 ...
- ASP.NET WEB API 2 框架揭秘 读书笔记(一)
第一章 概述 主要内容是介绍Web的基本概念,Restfull的基本概念及特性.最后介绍创建简单WebApi程序的步骤. Web的基本概念 IP/TCP协议簇分层,分为两种 链路层->网络层-& ...
- 《Java web 开发实战经典》读书笔记
去年年末,也就是大四上学期快要结束的时候,当时保研的事情确定了下来,终于有了一些空闲的时间可以学点实用的技术. 之前做数据库课程设计的时候,也接触过java web的知识,当时做了一个卖二手书籍的网站 ...
- Java web轻量级开发面试教程读书笔记:数据库方面,如何准备面试
如果在面试或与资深人事交流的过程中,你能有效合理地展示出本章所给出的一些知识点,那么对你的评价就会是"对数据库有深入了解",甚至能加上"有设计数据表的经验",即 ...
随机推荐
- komodo,mysql workBeach
跨平台的好软件,只不过自己的眼界太狭隘 Ubuntu下PPA安装,打开终端输入命令: sudo add-apt-repository ppa:mystic-mirage/komodo-edit ...
- oracle 锁的介绍 (转)
本文转自:http://blog.csdn.net/gyb2013/article/details/6929697 一.什么是锁: Oracle的锁机制是一种轻量级的锁定机制,不是通过构建锁列表来进行 ...
- c#自适应窗体的实现
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.W ...
- [U3D 添加大地、天空,用第一视角看看自己做的世界]
1.添加大地.天空. 在下方Assets文件夹里右键,导入素材包. Terrain(地形)和Skybox(天空盒子) 2.选中左边的Terrain,在inspector里,选择中间的刷子(地形),还有 ...
- Spring Cache 介绍
Spring Cache 缓存是实际工作中非常常用的一种提高性能的方法, 我们会在许多场景下来使用缓存. 本文通过一个简单的例子进行展开,通过对比我们原来的自定义缓存和 spring 的基于注释的 c ...
- Android中定时执行任务的3种实现方法
在Android开发中,定时执行任务的3种实现方法: 一.采用Handler与线程的sleep(long)方法(不建议使用,java的实现方式)二.采用Handler的postDelayed(Runn ...
- HDU 1213 How Many Tables(并查集)
传送门 Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Igna ...
- spring 初始化之后执行的方法
Spring初始化完成后直接执行一个方法,初始化数据(解决方法并执行两次) 在做WEB项目时,经常在项目第一次启动时利用WEB容器的监听.Servlet加载初始化等切入点为数据库准备数据,这些初始化数 ...
- 利用css3选择器及css3边框做出的特效(1)
利用border-radius及box-shadow制作圆角表格 界面效果图如下: css样式如下所示: * { margin:; padding:; } body { padding: 40px 1 ...
- bootstrap学习总结-05 常用标签3
1 单选框,多选框 1)单选框 单选框(radio)用于从多个选项中只选择一个.设置了 disabled 属性的单选或多选框都能被赋予合适的样式.对于和多选或单选框联合使用的 <label> ...