[AngularJS 1] Introduction to AngularJS
introduction:this article is going to introduce AngularJS in generally. I will write it through five points.Number one is what is AngularJS.Number two is why use Angular.Number three
is how angularJS works.Number four is about modules.Number five is my own summery.
Number one_what is it
Front -end javascript framework for creating web applications;
Open source maintained by Google;
MVC pattern
Handles common(and ofter trying tasks) such as DOM manipulation,updating UI based on data or input, registering callbacks;
Decarative programming
Number two_why use it
Good for dynamic web sites/web apps(VRUD based);
Framework imposes a structure that is good for organizetion;
Helps create responsive(fast) websites;
Easy to test-to create software that is easily maintained;
Number three_how it works
AngularJS will initialize when the DOM content is loaded;
Looks for the ng-app directive-if its found,that is the root of the app;
Directives can be declared a variety of ways:typically with the ng-prefix,but you can use data-ng;
It will load the module associated with the directive if specified;
PS: what is the difference between ng-prefix and data-ng? ok, when your brower's version is old, maybe you should use data-ng!
Number four_modules
what are modules?
It's containers for the various parts of your application(controllers,services etc). It's declarative-easy to understand. It's maintainable,readable,testable. It defines dependencies for our app.
Modules setup: A module is comprised of configuration and run blocks. Configuration blocks-executed during configuration and registration. Only peoviders and constants can be passed. Run blocks-happen
after the injector is created. Only instances and constants can be passed in and is like a main method-it kickstarts the application.
PS:Modules can depend on other modules and they are only loaded once.
Number five_summery
first of all, let me show some code:
<span style="font-family:KaiTi_GB2312;font-size:18px;"><!doctype html>
<html ng-app>
<head>
<script src="http://code.angularjs.org/angular-1.0.1.min.js"></script>
</head>
<body>
My name:<input type="text" ng-model="MyName" placeholder="please write down your name !">
<hr>
Hello, My name is {{MyName||''}}
</body>
</html></span>
please run the code in your brower, then there is surprise for you.
I gonna publish my blog in english, Maybe it's not good at the beginning, but it's okay . the next blog is about Angular Controllers!
[AngularJS 1] Introduction to AngularJS的更多相关文章
- AngularJS学习笔记二:AngularJS指令
AngularJS 指令: AngularJS 通过被称为 指令 的新属性来扩展 HTML. AngularJS 指令是扩展的 HTML 属性,带有前缀 ng-. 几个常用 指令: ng-app 指令 ...
- AngularJS学习笔记2——AngularJS的初始化
本文主要介绍AngularJS的自动初始化以及在必要的适合如何手动初始化. Angular <script> Tag 下面通过一小段代码来介绍推荐的自动初始化过程: <!doctyp ...
- [angularjs] MVC + Web API + AngularJs 搭建简单的 CURD 框架
MVC + Web API + AngularJs 搭建简单的 CURD 框架 GitHub 地址:https://github.com/liqingwen2015/Wen.MvcSinglePage ...
- AngularJS学习之旅—AngularJS 模块(十五)
一.AngularJS 模块 模块定义了一个应用程序. 模块是应用程序中不同部分的容器. 模块是应用控制器的容器. 控制器通常属于一个模块. 1.创建模块 通过 AngularJS 的 angular ...
- AngularJS学习之旅—AngularJS 控制器(六)
1.AngularJS 控制器 AngularJS 应用程序被控制器控制. ng-controller 指令定义了应用程序控制器. 控制器是 JavaScript 对象,由标准的 JavaScript ...
- AngularJS学习之旅—AngularJS 指令(三)
1.AngularJS 指令 AngularJS 通过被称为 指令 的新属性来扩展 HTML. AngularJS 通过内置的指令来为应用添加功能. AngularJS 允许你自定义指令.2.Angu ...
- AngularJS学习之旅—AngularJS 表达式(二)
1.AngularJS 表达式 AngularJS 表达式写在双大括号内:{{ expression }}. AngularJS 表达式把数据绑定到 HTML,这与 ng-bind 指令有异曲同工之妙 ...
- 【AngularJS学习笔记】AngularJS表单验证
AngularJS表单验证 AngularJS提供了一些自带的验证属性 1.novalidate:添加到HTML的表单属性中,用于禁用浏览器默认的验证. 2.$dirty 表单有填写记录 3.$v ...
- AngularJS学习笔记(1) - AngularJS入门
什么是AngularJS? AngularJS是建立在jQuery的一个轻量级版本之上的MVC框架.MVC将业务逻辑代码和视图.模型相分离.AngularJS提供的所有功能都可以通过使用JavaScr ...
随机推荐
- 黄聪:C#里如何使用WebBrowser获取处理AJAX生成的网页内容?
等待网页执行完毕(AJAX执行后). 使用webBrowser1.Document.Body.OuterHtml可以获取到AJAX产生的网页内容.
- HashMap 实现原理(复习)
1. HashMap的数据结构 数据结构中有数组和链表来实现对数据的存储,但这两者基本上是两个极端. 数组 数组存储区间是连续的,占用内存严重,故空间复杂的很大.但数组的二分查找时间复杂度小,为O(1 ...
- 工作中Linux常用命令
rpm -qa|grep -i mysql rpm -ev mysql-server-5.1.73-5.el6_6.x86_64 如果报: error: Failed dependencies: li ...
- RMAN_Oracle RMAN的常用Configure配置
2014-12-09 Created By BaoXinjian
- 转--Android资源总结(环境搭建/ 反编译工具)
在Android发展前景相当好的情况下,本人最近搜集了一些关于Android的相关资源,当然包含以前发布的博客内容,进行了一次大整合,希望对和我一样是Android的初学者管用,如在文章中有所错误,敬 ...
- ylbtech-dbs:ylbtech-3,BarCode(条码资源系统)
ylbtech-dbs:ylbtech-3,BarCode(条码资源系统) -- =============================================-- 条码资源系统-- YU ...
- 树莓派用USB蓝牙适配器连接蓝牙设备
下面分享如何配置蓝牙设备.1.连接蓝牙适配到Rpi板子usb上,安装相关蓝牙服务器和驱动 lsusb 查看设备是不是被发现 pi @RaspberryPi ~ $ lsusb Bus 001 Devi ...
- maven问题
pom.xml ... </dependencies> <repositories> <repository> <id>sf-nexus</id& ...
- 解决脱离rails使用activerecord报错 NameError: uninitialized constant ActiveRecord::Migrator::Zlib
上下文说明 原本系统是15.10,无奈只支持1年,所以今天升级16.04,环境答好后运行rake migratte报错 task :default => :migrate desc 'Run m ...
- maven项目导入eclipse
maven项目的配置文件 web java文件都在src下面 src/main/java src/main/webapp src/main/webapp/web-inf 导入后要重新添加jar包,设置 ...