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轻量级开发面试教程读书笔记:数据库方面,如何准备面试
如果在面试或与资深人事交流的过程中,你能有效合理地展示出本章所给出的一些知识点,那么对你的评价就会是"对数据库有深入了解",甚至能加上"有设计数据表的经验",即 ...
随机推荐
- VS调试时同时启动多个项目解决方法
选中要设置的项目,不要右击里面的属性,而是按f4时显示属性,下面总是在调试时启动设为false.
- ubuntu安装搜狗输入法
搜狗官网上说14.04直接安装deb包就行,无需配置. 但是经实践发现仍然需要配置一下== 命令: ibm@IBM:~$ sudo dpkg --get-selections | grep fcitx ...
- Bzoj4066 简单题
Time Limit: 50 Sec Memory Limit: 20 MBSubmit: 2185 Solved: 581 Description 你有一个N*N的棋盘,每个格子内有一个整数,初 ...
- Consuming a RESTful Web Service
本篇文章将介绍使用Spring来建立RESTful的Web Service. 我们通过一个例子来说明这篇文章:这个例子将会使用Spring的RestTemplate来从Facebook的提供的API中 ...
- BZOJ3224 普通平衡树
传送门: Treap 版本: //OJ 1999 //by Cydiater //2016.8.30 #include <iostream> #include <cstdio> ...
- HDU5672String(尺标法)
问题描述 有一个 10\leq10≤长度\leq 1,000,000≤1,000,000 的字符串,仅由小写字母构成.求有多少个子串,包含有至少k(1 \leq k \leq 26)k(1≤k≤26) ...
- web前端环境搭建
第一部分:浏览器 浏览器推荐chrome浏览器.FireFox浏览器. 1. chrome浏览器因为集成了Google Developer Tools(谷歌开发者工具),因此大受欢迎. 下载地址:ht ...
- springMVC的注解详解
springmvc常用注解标签详解 1.@Controller 在SpringMVC 中,控制器Controller 负责处理由DispatcherServlet 分发的请求,它把用户请求的数据经过业 ...
- XmlHttpRequest对象的获取及相关操作
一.获取XMLHttpRequest对象 方案一: function ajaxFunction(){ var xmlHttp; try{ // Firefox, Opera 8.0+, Safari ...
- IOS OC 计算器算法(不考虑优先级)
个人见解:为还在计算器算法方面迷惑的同学一个数据处理解决方案:定义一个可变数组array,一个可变字符串str,使字符通过[array addObject:str];方法添加到可变数组,每当触发运算符 ...