AngularJS学习(一)
参考文章:http://blog.csdn.net/dc_726/article/details/17010325
1、HelloWorld篇
1.1 环境
下载:angular-1.2.5min.js
1.2 源代码
<!doctype html>
<html ng-app>
<head>
<script src="angular-1.2.5.min.js"></script>
</head>
<body>
hello {{'world'}}!
</body>
<html
1.3 运行结果
2、双向数据绑定
2.1 源代码
<!doctype html>
<html ng-app>
<head>
<script src="angular-1.2.5.min.js"></script>
</head>
<body>
Your name:<input type="text" ng-model="yourname" placeholder="world">
<hr>
hello {{yourname || 'world'}}!
</body>
<html
2.2 运行结果
2.3、说明
文本输入指令<input ng-model="yourname"/> 绑定一个叫yourname的模型变量
双大括号标记yourname模型变量添加到问候语文本。
你不需要为改应用另外注册一个事件监听器或添加事件处理程序!
现在试着在输入框中输入您的名称,您键入的名称将立即更新显示在问候语中,这就是AngularJs的双向绑定概念。输入框的任何更改都会立即反应到模型变量(一个方向),模型变量的任何更改都会立即反映到问候语文本中(另一个方向)
AngularJS学习(一)的更多相关文章
- Angularjs学习---官方phonecat实例学习angularjs step0 step1
接下来一系列的文章都是学习https://docs.angularjs.org/tutorial的笔记,主要学习的angular-phonecat项目的实现,来介绍angularjs的使用. 1.下载 ...
- angularJS学习资源最全汇总
基础 官方: http://docs.angularjs.org angularjs官方网站已被墙,可看 http://www.ngnice.com/: 官方zip下载包 https://github ...
- 我的AngularJS 学习之旅
我的AngularJS 学习之旅 基础篇 1.Angular的 起源 2.比较Web 页面实现的几种方式 3.一些基本术语 4.Angular与其他框架的兼容性 5.总结 6.综合实例 很早之前就 ...
- 推荐10个很棒的AngularJS学习指南
AngularJS 是非常棒的JS框架,能够创建功能强大,动态功能的Web app.AngularJS自2009发布以来,已经广泛应用于Web 开发中.但是对想要学习Angular JS 的人而言,只 ...
- Angularjs学习---ubuntu12.04中karma安装配置中常见的问题总结
karma启动时出现了很多问题: 1.安装karma前提条件 安装karma首先要安装nodejs,npm然后才可以安装karma.nodejs,npm的安装过程可以参考文章:Angularjs学习- ...
- AngularJs学习总结-了解基本特性(-)
现在的前端项目中基本上都会用到angularjs框架,之前并不了解这个框架,也是因为最近接手的项目,所以打算好好的学习下它.之前都是搞pc端,现在接手的是移动端的项目,移动端UI框架用的是ionic+ ...
- [整理]AngularJS学习资源
https://angular.io/docs/js/latest/(2.0官方网站) http://www.linuxidc.com/Linux/2014-05/102139.htm(Angular ...
- AngularJs学习笔记--Forms
原版地址:http://code.angularjs.org/1.0.2/docs/guide/forms 控件(input.select.textarea)是用户输入数据的一种方式.Form(表单) ...
- AngularJs学习笔记--expression
原版地址:http://code.angularjs.org/1.0.2/docs/guide/expression 表达式(Expressions)是类Javascript的代码片段,通常放置在绑定 ...
- AngularJs学习笔记--directive
原版地址:http://code.angularjs.org/1.0.2/docs/guide/directive Directive是教HTML玩一些新把戏的途径.在DOM编译期间,directiv ...
随机推荐
- New Concept English three (45)
31w/m 65error In democratic countries any efforts to restrict the freedom of the press are rightly c ...
- scorm标准的LMS在客户端的运行机制
1)运行SCORM APIAdapter. 2)调用API初始化函数. 3)加载课件SCO初始化数据. 4)获取Data Model中的用户ID和用户姓名. 5)获取Data Mode ...
- 启动tomcat时出现The specified JRE installation does not exist 如何解决?
卸载JDK1.6,安装JDK1.7,启动tomcat6.0提示 The specified JRE installation does not exist 如何解决? window -->pre ...
- selenium webdriver入门
写在前面:最近在研究UI自动化测试的过程中,发现公司里通常用的是AutomanX框架,而这个框架实际上是基于selenium webdriver框架的,所以在编写测试用例时,很多语法都是直接使用sel ...
- Android 进阶11:进程通信之 ContentProvider 内容提供者
学习启舰大神,每篇文章写一句励志的话,与大家共勉. When you are content to be simply yourself and don't compare or compete, e ...
- Games Delphi developers play
Original link: Games Delphi developers play Delphi game developers are stupid people having too ma ...
- OpenCV获取RTSP解码播放
#include <opencv2/opencv.hpp> int main(int argc, char **argv){ IplImage *pFrame = NULL, *srcIm ...
- 浅谈java使用指定字符集编码,以及常见的字符集
问题的引入:在InputStreamReader(OutputStreamWriter)的构造方法中,有指定字符集编码,那么什么是字符集?有哪些常用的字符集?怎么用字符集进行编码? 一 什么是字符 ...
- ranch实现游戏服务器
在 erlang游戏开发tcp 我们建立起了自己的socket tcp 服务器的基本骨架.当时面对并发情况下,多人同一时刻连接服务器的时候,我们的基本骨架 还是难以应付处理.这就使我不得不想对这样的情 ...
- HDU - 6098:Inversion(暴力均摊)
Give an array A, the index starts from 1. Now we want to know B i =max i∤j A j Bi=maxi∤jAj , i≥2 i≥ ...