﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-paulwong-随笔分类-ANGULARJS</title><link>http://www.blogjava.net/paulwong/category/54396.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 15 Jan 2022 01:54:04 GMT</lastBuildDate><pubDate>Sat, 15 Jan 2022 01:54:04 GMT</pubDate><ttl>60</ttl><item><title>20 个有用的 Angular.js 工具</title><link>http://www.blogjava.net/paulwong/archive/2015/08/12/426743.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 12 Aug 2015 05:32:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2015/08/12/426743.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/426743.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2015/08/12/426743.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/426743.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/426743.html</trackback:ping><description><![CDATA[<div id="translate_45244" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><p style="margin: 0px 0px 5pt; padding: 0px;"><a href="https://www.agriya.com/services/angularjs-development" target="_blank" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">喜欢 Angular.js？</a>我们为开发者编写了一份最佳 angular.js 工具和资源清单，这可让使用 angular 开发应用程序变得高效。</p><p style="margin: 0px 0px 5pt; padding: 0px;">对于大多数想要设计动态 web 应用的开发者而言，Angular.js 成为了一个可以选择的框架。angularjs 开发者如果想开始一个 AngularJS 工程，为了采取成熟的方式开发网页，他们或许需要很多工具。</p><p style="margin: 0px 0px 5pt; padding: 0px;">在开始使用 angular.js 之前，Angular.js 新手或许也想读一些优秀的 angular.js 书籍。</p><p style="margin: 0px 0px 5pt; padding: 0px;">我们同样也编写了一份庞大的在线 angular.js 教程清单。</p><p style="margin: 0px 0px 5pt; padding: 0px;">为了减轻使用 AngularJS 开发 web 应用的负担，这里列出了几个出色的工具，包括测试、前端开发、编辑、函数库、扩展、模块、代码生成器、网格工具。</p></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/u/1035206" title="shirleywong" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://www.oschina.net/img/portrait.gif?t=1399607780000" align="absmiddle" alt="shirleywong" title="shirleywong" user="1035206" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/u/1035206" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">shirleywong</a><br style="margin: 0px; padding: 0px;" />翻译于 1周前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45266" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45245" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h3>Angular.js 开发最佳 IDE</h3><p style="margin: 0px 0px 5pt; padding: 0px;">Angular.js 需要的大部分集成开发环境（IDE）和轻量级的编辑器列在了下面。</p><h3><a target="_blank" href="http://www.oschina.net/p/webstorm" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Webstorm</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Webstorm是一个出色的代码编辑器，它完全理解工程，可以为任何类型的网站提供高质量的代码。它支持所有最流行最新的网站开发技术。使用这个工具开发网站，可以很好地集成单点或流程。&nbsp;</p><h3><a target="_blank" href="http://www.oschina.net/p/aptana" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Aptana</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Aptana 是一具集成开发环境，可以帮助你优雅地创建网站应用。使用它做为 AngularJS 的集成开发工具，你需要在 Eclipse 商店激活 AngularJS Eclipse 扩展。</p><h2><a target="_blank" name="Sublime-Text" href="http://www.sublimetext.com/" rel="nofollow" style="margin: 0px; padding: 0px; color: rgb(62, 98, 166); outline: 0px;"></a></h2></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/u/870943" title="wancheng" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/435/870943_50.jpeg?t=1432629911000" align="absmiddle" alt="wancheng" title="wancheng" user="870943" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/u/870943" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">wancheng</a><br style="margin: 0px; padding: 0px;" />翻译于 1周前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45272" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45246" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h3><a target="_blank" href="http://www.oschina.net/p/sublimetext" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">文本编辑器 Sublime</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">对 AngularJS Web 开发者来说，方便的文本编辑工具是 Sublime。它帮助程序员使用快捷方式或几个按键实现编码。它具有很强的适应性，可以定制任何类型的编程环境。它也可以按照你的意愿分块编辑。它还可以轻松地在项目之间切换，所有的修改都将自动保存在各自的项目中。</p><h3>Angular.js 的专用测试工具<br style="margin: 0px; padding: 0px;" /></h3><p style="margin: 0px 0px 5pt; padding: 0px;">测试是开发的重要组成部分，无论对于使用 Angular.js 还是任何其他软件都是如此。下面的工具可以帮助你简化采用 Angular.js 开发的应用程序的测试。</p><p style="margin: 0px 0px 5pt; padding: 0px;">这些工具都是在线 JavaScript 测试工具的好伴侣。</p><h3><a target="_blank" href="http://www.oschina.net/p/protractor" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Protractor</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Protractor 是一个端到端的测试框架，贯穿于 AngularJS，是一个完全自动化的测试工具。它可以运行在真实的浏览器中测试你的应用程序。它使用了&nbsp;<a target="_blank" href="http://www.oschina.net/p/preceptor-webdriver" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">WebDriver</a>，Mocha,&nbsp;<a target="_blank" href="http://www.oschina.net/p/jasmine" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">jasmine</a>, Node.js,&nbsp;<a target="_blank" href="http://www.oschina.net/p/selenium" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">selenium</a>&nbsp;和<a target="_blank" href="http://www.oschina.net/p/cucumber-js" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">cucumber</a>&nbsp;等都使用的伟大的技术。</p><p style="margin: 0px 0px 5pt; padding: 0px;">当所有的待处理网页任务完成时，它会自动使用AngularJS的应用进行通信。所以，你在测试时不需要使用等待或睡眠命令。</p></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/walkpass" title="Iam魔方" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/734/1468402_50.jpg?t=1394685421000" align="absmiddle" alt="Iam魔方" title="Iam魔方" user="1468402" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/walkpass" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">Iam魔方</a><br style="margin: 0px; padding: 0px;" />翻译于 1周前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45274" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45247" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h3><a target="_blank" href="http://www.oschina.net/p/jasmine" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Jasmine</a><br style="margin: 0px; padding: 0px;" /></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Jasmine 是一个行为驱动开发框架，专为 Javascript 用户创建。它提供了基本的测试框架，并且可以持续维护。所有测试都可以使用一个 all-in-one 的包完成，这是 Jasmine 的主要特点，高效测试你的应用。<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />这个框架的一个缺点是它不能感知运行平台（浏览器）。如果配合Karma使用这个问题很容易避免。<br style="margin: 0px; padding: 0px;" /><br style="margin: 0px; padding: 0px;" />Karma 可以做为测试运行者配合 Jasmine 使用。它是一个测试框架帮且你高效地测试应用。&nbsp;</p><h3><a target="_blank" href="http://www.oschina.net/p/code-orchestra" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Code Orchestra</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">它是一个绝对意义上的前端开发工具帮助你创建和测试网站应用。你可以实时写代码，根据建议修改代码，以同样的格式保存代码。通过这个工具修改后的代码会自动布署到运行中的应用。</p></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/u/870943" title="wancheng" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/435/870943_50.jpeg?t=1432629911000" align="absmiddle" alt="wancheng" title="wancheng" user="870943" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/u/870943" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">wancheng</a><br style="margin: 0px; padding: 0px;" />翻译于 1周前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45275" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45248" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h3>最好的 Angular.js 函数库<br style="margin: 0px; padding: 0px;" /></h3><p style="margin: 0px 0px 5pt; padding: 0px;">下面是一些有用的库，它们可以增强 angular.js 框架的能力，对开发者有所帮助。没有必要从头构建那些可能已经成为开放源码的函数库。<br style="margin: 0px; padding: 0px;" /></p><p style="margin: 0px 0px 5pt; padding: 0px;"><a target="_blank" name="CodePen" href="http://codepen.io/lsgrrd/pen/pnvwf" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;"><strong style="margin: 0px; padding: 0px;">CodePen</strong></a></p><p style="margin: 0px 0px 5pt; padding: 0px;">对于所有 HTML，CSS 和 JavaScript 的前端开发者，CodePen 是一款完美的编辑工具。这个工具可以最大限度地减少对网站的创建、测试和完善的繁琐的网页开发工作。它是一个协作的在线编程环境。</p><p style="margin: 0px 0px 5pt; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.5; font-size: 10pt;">Web 开发人员可以清晰地跨平台实时查看。它有一个浏览器中的代码编辑器，可以自动地迅速地上传多个文件。这个功能可协助 Web 开发人员在几秒的时间内创建一个新的代码。</span></p><p style="margin: 0px 0px 5pt; padding: 0px;"><a target="_blank" name="Angular-Fire" href="https://www.firebase.com/docs/web/libraries/angular/index.html" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;"><strong style="margin: 0px; padding: 0px;">Angular Fire</strong></a></p><p style="margin: 0px 0px 5pt; padding: 0px;">使用 Angular Fire，可以轻松地帮助你开发 AngularJS 的应用后台。AngularJS 绑定的 Firebase 已经正式被 Angular Fire 支持。Firebase 是一个基于云计算的平台，可以很容易地集成实时应用和快速创建后台。</p><p style="margin: 0px 0px 5pt; padding: 0px;">当 Firebase 和 Angular Fire 组合在一起，它们有助于以更快的速度同步数据和提供良好的用户管理服务。它还提供了一个三向的数据绑定、用户身份验证和静态托管。</p></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/walkpass" title="Iam魔方" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/734/1468402_50.jpg?t=1394685421000" align="absmiddle" alt="Iam魔方" title="Iam魔方" user="1468402" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/walkpass" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">Iam魔方</a><br style="margin: 0px; padding: 0px;" />翻译于 7天前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45304" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45249" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h2><a target="_blank" name="AngularUI" href="http://angular-ui.github.io/" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">AngularUI</a><br style="margin: 0px; padding: 0px;" /></h2><p style="margin: 0px 0px 5pt; padding: 0px;">AngularJS 以高效率创建单页面应用而出名. 创建这些单页面应用时候，我们需要一个灵活的路由，这个优秀的AngularJS框架是构建一个全面的UI组件俗称ui-router。&nbsp;它能根据应用程序的状态提供一个简单的导航和改变视图,而不仅仅是基于URL。<br style="margin: 0px; padding: 0px;" />AngularUI还包含非常多的UI组件，这些组件是使用原生指令像ui&#8212;maps,ui-calendar,ui-Bootstrap创建的。这些UI组件和指令可以更快建设Angular网站</p><h2><a target="_blank" name="UI-Bootstrap" href="http://angular-ui.github.io/bootstrap/" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">UI Bootstrap</a></h2><p style="margin: 0px 0px 5pt; padding: 0px;">UI Bootstrap是一个不同寻常的AngularUI组件,它能帮助你创建基于智能手机的web应用程序，而且用户体验不错。这个UI组件提供的AngularJS原生指令完全兼容Twitte Bootstrap</p></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/benhaile" title="成熟的毛毛虫" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/514/1028150_50.jpg?t=1383582766000" align="absmiddle" alt="成熟的毛毛虫" title="成熟的毛毛虫" user="1028150" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/benhaile" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">成熟的毛毛虫</a><br style="margin: 0px; padding: 0px;" />翻译于 5天前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45329" style="margin: 0px 2px; padding: 0px; color: #aa0000;">1</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45250" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h3>Angular.js 有用的扩展和工具<br style="margin: 0px; padding: 0px;" /></h3><p style="margin: 0px 0px 5pt; padding: 0px;">下面是一些 Angular.js 扩展，可以满足一些特殊应用之需。</p><h3><a target="_blank" href="http://www.oschina.net/p/ng-inspector" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Ng-Inspector</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Ng-Inspector 是一个优秀的浏览器插件，支持 Firefox，Chrome 和 Safari,复用它可以创建一个探测控制面板，方便开发，调试 AngularJS 应用，它提供了完整的辅助功能。</p><p style="margin: 0px 0px 5pt; padding: 0px;">使用它可以更方便的和你的应用交互，还可以实时更新。它还可以看到全部范围内的层次结构，模型，类型和值。点击你关注的一个范围，它会高亮显示相应的 DOM 结点。</p><h3><a target="_blank" href="http://www.oschina.net/p/angularjs-batarang" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">AngularJS Batarang</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">你可以使用 AngularJS Batarang 来调试你的 AngularJ S应用，它是一个专为 Chrome 提供的插件。它帮助你改善应用性能。还可能衡量调节性能的进度。</p><h2><a target="_blank" name="Restangular" href="https://github.com/mgonto/restangular" rel="nofollow" style="margin: 0px; padding: 0px; color: rgb(62, 98, 166); outline: 0px;"></a></h2></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/u/870943" title="wancheng" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/435/870943_50.jpeg?t=1432629911000" align="absmiddle" alt="wancheng" title="wancheng" user="870943" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/u/870943" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">wancheng</a><br style="margin: 0px; padding: 0px;" />翻译于 4天前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45378" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45251" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h3><a target="_blank" href="http://www.oschina.net/p/restangular" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Restangular</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">AngularJS 独有的一个服务是 Restangular，它可以帮助您轻松应对各种要求，例如获取、发送、删除以及把数据存入数据库。它对于所有从 RESTful API 中大规模存取数据的 AngularJS 应用都很有必要。</p><p style="margin: 0px 0px 5pt; padding: 0px;">Generator Angular - 一个有用的工具<br style="margin: 0px; padding: 0px;" /></p><h3><a target="_blank" href="http://www.oschina.net/p/angularjs-generator" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Yeomen Generator</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">你可以很容易地开始一个具有合理的默认值和最好的用例的项目。建立这样的 Angular 应用，这款 Yeomen generator 工具是非常有用的。它只需几条终端的命令，便加速了 AngularJS 应用的开发过程。这个工具是非常有用的。这些专用的生成工具将有助于应用了解项目的有关信息，并有助于开发和测试应用程序。<br style="margin: 0px; padding: 0px;" /></p></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/walkpass" title="Iam魔方" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/734/1468402_50.jpg?t=1394685421000" align="absmiddle" alt="Iam魔方" title="Iam魔方" user="1468402" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/walkpass" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">Iam魔方</a><br style="margin: 0px; padding: 0px;" />翻译于 3天前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45381" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45252" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h3><a target="_blank" href="http://www.oschina.net/p/angular-deckgrid" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Angular Deckgrid</a><br style="margin: 0px; padding: 0px;" /></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Angular Deckgrid 可以为你提供响应度和颜值俱高的应用，可以适配不同的移动终端。轻量级类砖石结构易于创建灵活的表格，高效创建图片展示。&nbsp;</p><h3><a target="_blank" href="http://www.oschina.net/p/radian" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Radian</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Radian 是一个优秀的框架，使用它只需要少量的设置就可以开启 AngularJS 项目。在多人开发项目中它是一个理想的选择。</p><h3><a target="_blank" href="http://www.oschina.net/p/lumx" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Lumx</a></h3><p style="margin: 0px 0px 5pt; padding: 0px;">Lumx 以快速简单的方式帮助你创建简单而优雅的应用。 这个可响应式前端框架是基于AngularJS 和Google 材料设计规范。这个工具可嵌入最新的技术，如 Sass 预处理器，AngularJS 和 JQuery，能极大地提高 web 应用的性能。</p><h2><a target="_blank" name="Angular-Gettext" href="https://angular-gettext.rocketeer.be/" rel="nofollow" style="margin: 0px; padding: 0px; color: rgb(62, 98, 166); outline: 0px;"></a></h2></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/u/870943" title="wancheng" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/435/870943_50.jpeg?t=1432629911000" align="absmiddle" alt="wancheng" title="wancheng" user="870943" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/u/870943" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">wancheng</a><br style="margin: 0px; padding: 0px;" />翻译于 1天前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45391" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45253" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h2><a href="http://www.oschina.net/p/angular-gettext" target="_blank" name="Angular-Gettext" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">Angular Gettext</a><br style="margin: 0px; padding: 0px;" /></h2><p style="margin: 0px 0px 5pt; padding: 0px;">你可以用英语编码，在编码需要被翻译的地方加上注解。Angular Gettext 工具就会自动翻译那些独立的部分。这是 AngularJS 非常简单而强大的翻译支持工具。</p><h2><a href="http://www.oschina.net/p/ngdocs" target="_blank" name="NgDocs" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">NgDocs</a></h2><p style="margin: 0px 0px 5pt; padding: 0px;">AngularJS 框架内置 ngDocs 工具可以简化你项目文档和参考手册的相关工作。这款基于 Android 的工具也能提供给所有新手一些容易跟进的教程。</p><h2><a target="_blank" name="NgTables" href="http://ng-table.com/" rel="nofollow" style="margin: 0px; padding: 0px; color: rgb(62, 98, 166); outline: 0px;"></a></h2></div></td><td valign="top" style="margin: 0px; padding: 0px 6px; width: 210px;"><a href="http://my.oschina.net/linuxhitlover" title="叶秀兰" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;"><img src="http://static.oschina.net/uploads/user/432/865233_50.jpg?t=1436794387000" align="absmiddle" alt="叶秀兰" title="叶秀兰" user="865233" style="margin: 5px 0px 0px; padding: 2px; border: 1px solid #dddddd; opacity: 0.9; float: left; width: 46px; height: 46px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" /></a><div style="margin: 0px 10px; float: left; width: 126px; height: 45px;"><h6><a href="http://my.oschina.net/linuxhitlover" target="_blank" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px; text-decoration: none;">叶秀兰</a><br style="margin: 0px; padding: 0px;" />翻译于 18小时前</h6><p style="margin-right: 0px; margin-left: 0px; padding: 0px; color: #666666;"><em id="vote_count_45392" style="margin: 0px 2px; padding: 0px; color: #aa0000;">0</em>人顶</p></div><div style="margin: 0px; clear: both; font-size: 1px; line-height: 0;"></div><p style="margin: 20px 0px 0px; padding: 0px; height: 30px; line-height: 30px; color: #666666;"><a style="margin: 0px; padding: 0px; color: #ffffff; outline: 0px; height: 30px; float: left; border: 0px solid #000000; font-weight: bold; cursor: pointer; font-size: 12pt; background: #d1c0a5;"><span style="margin: 0px 0px 0px 10px; padding: 0px 10px 0px 0px; float: left; height: 30px;">顶</span></a>&nbsp;翻译的不错哦!</p></td></tr></tbody></table></div><div id="translate_45254" style="margin: 0px; border: 3px solid #f9f9f9; font-family: 'Microsoft YaHei', Verdana, sans-serif, 宋体; font-size: 13.3333330154419px; line-height: normal; background-color: #ffffff;"><table style="margin: 0px; padding: 10px 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border-right-style: solid; border-right-color: #e3e3e3;"><div style="margin: 0px; padding-right: 10px; padding-left: 10px; line-height: 1.6; width: 750px; font-size: 10.5pt; overflow: hidden;"><h2><a href="http://www.oschina.net/p/ngtable" target="_blank" name="NgTables" rel="nofollow" style="margin: 0px; padding: 0px; color: #3e62a6; outline: 0px;">NgTables</a><br style="margin: 0px; padding: 0px;" /></h2><p style="margin: 0px 0px 5pt; padding: 0px;">无论是简单还是复杂的 Web 应用，在 AngularJS 框架中很容易创建一个表格，然后通过实用的 ngTables 工具进行高效的管理。ngTable 是 AngularJS 表格指令，支持排序，过滤和分页，在编译步骤中自动生成带有标题和过滤器的标题行。</p><p style="margin: 0px 0px 5pt; padding: 0px;">ngTable 支持定制过滤选项，表格分组，表格外部数据控制 等等功能。</p><p style="margin: 0px 0px 5pt; padding: 0px;">总的来说，这些都是创建任意 AngularJS Web 应用的，最有用的工具集合。用好这些工具可以帮助你轻松高效的创建 AngularJS 项目。</p></div></td></tr></tbody></table></div><img src ="http://www.blogjava.net/paulwong/aggbug/426743.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2015-08-12 13:32 <a href="http://www.blogjava.net/paulwong/archive/2015/08/12/426743.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>2013年度最强AngularJS资源合集</title><link>http://www.blogjava.net/paulwong/archive/2014/07/16/415872.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 16 Jul 2014 01:01:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2014/07/16/415872.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/415872.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2014/07/16/415872.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/415872.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/415872.html</trackback:ping><description><![CDATA[<p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong><a href="http://www.kuqin.com/shuoit/20140708/341106.html"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS</a>是Google开源的一款JavaScript MVC框架，弥补了HTML在构建应用方面的不足，</strong>其通过使用指令（directives）结构来扩展HTML词汇，使开发者可以使用HTML来声明动态内容，从而使得Web开发和测试工作变得更加容易。</p><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><a href="http://img.kuqin.com/upimg/allimg/140708/230555A45-0.jpg" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;"><img src="http://img.kuqin.com/upimg/allimg/140708/230555A45-0.jpg" border="0" alt="" style="margin: 0px 0px 10px; padding: 0px; border: none; max-width: 580px;" /></a></p><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>AngularJS诞生以来，吸引了大量的目光，也迅速成为了Web开发领域的新宠。本文整理了2013年度一些非常有价值的AngularJS相关教程和资源</strong>，如果你想了解AngularJS或正在使用AngularJS，那么这些资源肯定会为你的学习和进阶过程带来帮助。</p><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>一、了解AngularJS</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://zh.wikipedia.org/wiki/AngularJS" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS维基百科</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.csdn.net/article/2013-10-08/2817118-AngularJS-Framework-Google" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">CSDN专访AngularJS框架创始人Misko Hevery</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.csdn.net/article/2013-09-09/2816880-Angular-Ember-Javascript-Frameworks" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Angular.js VS. Ember.js：谁将成为Web开发的新宠？</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>二、中文资源</strong></p><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>1. 中文系列资源</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://damoqiongqiu.iteye.com/category/282002" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS系列教程文章</a>&#8211; 大漠穷秋</li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://angularjs.cn/T006" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS入门系列教程</a>&#8211; AngularJS中文社区</li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.zouyesheng.com/"  "="" target="_blank" style="color: #cc0000; outline-style: none;">AngularJS学习笔记</a>&#8211; 邹业盛</li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.zhihu.com/topic/19837063" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS精彩问答</a>- 知乎</li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>2. 其他单篇文章</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.lovelucy.info/angularjs-best-practices.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS 最佳实践</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.infoq.com/cn/news/2013/11/how-to-think-angularjs" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">有jQuery背景的开发者如何建立起AngularJS的思维模式？</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.gbin1.com/technology/javascript/20130121-three-reasons-for-using-angularjs/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">现在就开始使用AngularJS的三个重要原因</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.infoq.com/cn/news/2013/02/angular-web-app" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用AngularJS构建大型Web应用</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.cnblogs.com/whitewolf/archive/2013/03/24/2979344.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Angularjs开发一些经验总结</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://blog.jobbole.com/48979/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">5个示例带你学习AngularJS</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>3. 中文书籍</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://item.jd.com/11342818.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">《使用AngularJS开发下一代WEB应用》</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>三、英文资源</strong></p><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>1. AngularJS入门教程</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://code-like-a-poem.blogspot.com.au/2013/03/behold-angularjs-is-here-about.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS傻瓜教程系列</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://code.tutsplus.com/tutorials/5-awesome-angularjs-features--net-25651"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS移动开发权威指南</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.revillweb.com/tutorials/angularjs-in-30-minutes-angularjs-tutorial/"  ""="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS 30分钟入门</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://fastandfluid.com/publicdownloads/AngularJSIn60MinutesIsh_DanWahlin_May2013.pdf?utm_source=javascriptweekly&amp;utm_medium=email" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">60分钟掌握AngularJS</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://joelhooks.com/blog/2013/04/24/modeling-data-and-state-in-your-angularjs-application/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">在你的AngularJS应用中建模数据</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.benlesh.com/2013/02/angularjs-creating-service-with-http.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用$https创建服务</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://blog.revolunet.com/blog/2013/06/01/starting-with-angularjs/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">了解AngularJS的5个步骤</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://weblogs.asp.net/dwahlin/dynamically-loading-controllers-and-views-with-angularjs-and-requirejs"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS和RequireJS的动态加载控制器和视图</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://trochette.github.io/Angular-Design-Patterns-Best-Practices/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">先进的设计模式和最佳实践</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://flippinawesome.org/2013/08/05/animating-with-angularjs/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS动画</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://weblogs.asp.net/dwahlin/using-an-angularjs-factory-to-interact-with-a-restful-service"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS Factory与RESTful服务的交互</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.davidsalter.com/2013/08/16/using-angular-dot-js-factories-to-get-remote-data/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用Angular.js Factory获取远程数据</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.sitepoint.com/10-reasons-use-angularjs/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用AngularJS的10个理由</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://blog.xebia.com/2013/09/01/differences-between-providers-in-angularjs/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS中Providers之间的差异</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.kidsil.net/2013/09/filtering-with-angularjs/"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS过滤</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.artandlogic.com/blog/2013/03/angularjs-for-jquery-developers/"  ""="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">针对jQuery开发者的AngularJ教程</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://wintellect.com/blogs/jlikness/10-reasons-web-developers-should-learn-angularjs" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Web开发者应该了解AngularJS的10个理由</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://kirkbushell.me/when-to-use-directives-controllers-or-services-in-angular/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Angular Js：何时应该使用Directive、Controller和Service？</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://blog.thousandeyes.com/creating-extensible-widgets-part-1-jquery-to-angularjs/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">30秒从jQuery转到AngularJS</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>2. AngularJS指令学习</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.phloxblog.in/jquery-plugin-angular-js-directive-clean-html-approach/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">为jQuery插件构建AngularJS指令</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.phloxblog.in/d3-js-angular-directive/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">为D3.js条形图构建AngularJS指令</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.directiv.es/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">www.directiv.es：AngularJS指令库</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://github.com/agrublev/Angular-localStorage" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Angular-localStorage</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://twofuckingdevelopers.com/2013/08/videogular-an-html5-video-player-for-angularjs/"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Videogular：一个基于AngularJS的HTML5视频播放器</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://jmdobry.github.io/angular-cache/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Angular-cache</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://angular-ui.github.io/bootstrap/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">可用于Twitter Bootstrap的Angular指令</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://github.com/wesleyhales/angular-charts" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Angular的图表指令和服务</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://modernjavascript.blogspot.com.au/2013/10/angularjs-table-sort.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">表排序</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>3. AngularJS应用开发实战</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://weblogs.asp.net/dwahlin/learning-angularjs-by-example-the-customer-manager-application"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">通过示例学习AngularJS&#8212;&#8212;客户管理应用程序</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.recursiverobot.com/post/53767548784/angularjs-with-indexeddb-using-a-helper-library" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS和IndexedDB结合使用</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://icelab.com.au/articles/levelling-up-with-angularjs-building-a-reusable-click-to-edit-directive/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS：构建一个可重用的点击编辑指令</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://responsiblysourced.wordpress.com/2013/07/08/reactive-real-time-log-search-with-play-akka-angularjs-and-elasticsearch/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Play、Akka、AngularJS和Elasticsearch打造的实时日志搜索功能</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://www.firebase.com/blog/2013-07-16-build-your-own-feed-reader.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用Firebase和AngularJS打造自己的Google Reader</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://abou-kone.com/2013/07/17/developing-a-mobile-app-with-phonegap-angularjs-and-expressjs-part-i/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用Phonegap、AngularJS和ExpressJS开发一个移动App</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://matthiasnehlsen.com/blog/2013/08/13/birdwatch-angularjs-elasticsearch-play/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">BirdWatch v0.2：基于AngularJS、ElasticSearch和Play Framework的Tweet流分析工具</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.opensourceconnections.com/2013/08/25/instant-search-with-solr-and-angular/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">基于Solr和AngularJS的即时搜索工具</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://github.com/amirrajan/sortis" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Sortis：高级用户的Twitter客户端，初学者的跳板</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://timothy.userapp.io/post/64117882900/customizable-twitter-timeline-for-angularjs" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">可定制的Twitter AngularJS时间轴</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://seanhess.github.io/2013/10/14/angularjs-directive-design.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS指令设计更轻松</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>4. AngularJS游戏开发实战</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.sitepoint.com/angularjs-tutorial-build-an-app-using-directives-and-data-binding/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">基于CoffeeScript和AngularJS的画圈打叉游戏</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://github.com/callmehiphop/mario-cards" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">超级马里奥卡片翻转游戏</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>5. AngularJS工作流程和测试</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.youtube.com/watch?v=UYVcY9EJcRs" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS的测试策略</a>[视频]</li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.portlandwebworks.com/blog/combining-yeoman-angularjs-and-cordova-mobile-development" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用Combining Yeoman、AngularJS和Cordova开发移动App</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.youtube.com/watch?v=eUmDDxrvqSs" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">介绍Angular、Yeoman和Chrome应用程序</a>[视频]</li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.phloxblog.in/angular-js-tests-jasmine/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用Jasmine测试Angular.js应用</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用AngularJS和Karma进行全谱系测试</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://github.com/m7r/grunt-ngdocs" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">使用Grunt插件创建AngularJS文档</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://github.com/joshdmiller/ng-boilerplate" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">ng-boilerplate：新的AngularJS项目的样板</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="https://github.com/angular/angularjs-batarang" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">基于AngularJS的Chrome Web检查器扩展</a></li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;"><a href="http://weblogs.asp.net/dwahlin/using-the-angularjs-package-for-sublime-text"  "="" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">在Sublime Text中使用AngularJS包</a></li></ul><p style="margin: 15px 0px; padding: 0px; border: 0px; list-style-type: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><strong>6. AngularJS书籍</strong></p><ul style="margin: 10px 0px; padding: 0px 0px 0px 20px; border: 0px; list-style: none; font-family: Arial, Helvetica, sans-serif, 瀹嬩綋; line-height: 24px; background-color: #fcf1f5;"><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;">《<a href="http://www.manning.com/bford/" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">AngularJS in Action</a>》</li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;">《<a href="https://leanpub.com/ng-book" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">The Beginner&#8217;s guide to AngularJS</a>》</li><li style="margin: 0px auto; padding: 0px 0px 0px 20px; border: 0px; list-style: none; background: url(http://www.kuqin.com/new/images/wz_d.png) no-repeat;">《<a href="https://www.packtpub.com/angularjs-web-application-development/book" target="_blank" style="color: #800080; text-decoration: none; outline-style: none;">Mastering Web Application Development with AngularJS</a>》</li></ul><img src ="http://www.blogjava.net/paulwong/aggbug/415872.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2014-07-16 09:01 <a href="http://www.blogjava.net/paulwong/archive/2014/07/16/415872.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>通过终端调试 AngularJS 应用</title><link>http://www.blogjava.net/paulwong/archive/2014/07/11/415691.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Fri, 11 Jul 2014 00:11:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2014/07/11/415691.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/415691.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2014/07/11/415691.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/415691.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/415691.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 当我们构建AngularJS应用时，通过浏览器（如Chrome，Firefox和IE）的JavaScript控制台访问应用中隐藏的数据和服务总会有些困难。下面是一些简单的技巧可以帮助我们通过Javascript控制台来查看或者控制正在运行的Angular应用，使得应用可以比较容易进行测试，修改，甚至实时的修改我们的Angular应用：1： 访问作用域通过一行简单的JS程序访问页面中任何作用域（甚至...&nbsp;&nbsp;<a href='http://www.blogjava.net/paulwong/archive/2014/07/11/415691.html'>阅读全文</a><img src ="http://www.blogjava.net/paulwong/aggbug/415691.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2014-07-11 08:11 <a href="http://www.blogjava.net/paulwong/archive/2014/07/11/415691.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>angular-smarty</title><link>http://www.blogjava.net/paulwong/archive/2014/06/19/414918.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Thu, 19 Jun 2014 01:01:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2014/06/19/414918.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/414918.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2014/06/19/414918.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/414918.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/414918.html</trackback:ping><description><![CDATA[angular-smarty 是一个基于 AngularJS 实现的自动完成的 UI 实现。<br /><br />使用方法：<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">html</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">head</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">title</span><span style="color: #0000FF; ">&gt;</span>angular-smarty&nbsp;demo<span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">title</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">link&nbsp;</span><span style="color: #FF0000; ">rel</span><span style="color: #0000FF; ">="stylesheet"</span><span style="color: #FF0000; ">&nbsp;type</span><span style="color: #0000FF; ">="text/css"</span><span style="color: #FF0000; ">&nbsp;href</span><span style="color: #0000FF; ">="smarty.css"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">link</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">head</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">body&nbsp;</span><span style="color: #FF0000; ">ng-controller</span><span style="color: #0000FF; ">="SmartyController"</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">div&nbsp;</span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="container-main"</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">h1</span><span style="color: #0000FF; ">&gt;</span>angular-smarty&nbsp;demo<span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">h1</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">div&nbsp;</span><span style="color: #FF0000; ">class</span><span style="color: #0000FF; ">="container-autocomplete"</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">input&nbsp;</span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text"</span><span style="color: #FF0000; ">&nbsp;smarty-input&nbsp;select</span><span style="color: #0000FF; ">="setSelected(x)"</span><span style="color: #FF0000; "><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index</span><span style="color: #0000FF; ">="selected"</span><span style="color: #FF0000; ">&nbsp;list-items</span><span style="color: #0000FF; ">="suggestions"</span><span style="color: #FF0000; ">&nbsp;close</span><span style="color: #0000FF; ">="suggestionPicked()"</span><span style="color: #FF0000; "><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selection-made</span><span style="color: #0000FF; ">="selectionMade"</span><span style="color: #FF0000; ">&nbsp;ng-model</span><span style="color: #0000FF; ">="prefix"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">input</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">div&nbsp;</span><span style="color: #FF0000; ">smarty-suggestions-box</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">div</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">input&nbsp;</span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text"</span><span style="color: #FF0000; ">&nbsp;focus-me&nbsp;focus-when</span><span style="color: #0000FF; ">="{{selectionMade}}"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">input</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">div</span><span style="color: #0000FF; ">&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">div</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">body</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">script&nbsp;</span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text/javascript"</span><span style="color: #FF0000; ">&nbsp;src</span><span style="color: #0000FF; ">="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">script&nbsp;</span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text/javascript"</span><span style="color: #FF0000; ">&nbsp;src</span><span style="color: #0000FF; ">="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">script&nbsp;</span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text/javascript"</span><span style="color: #FF0000; ">&nbsp;src</span><span style="color: #0000FF; ">="smarty-config.js"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">script&nbsp;</span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text/javascript"</span><span style="color: #FF0000; ">&nbsp;src</span><span style="color: #0000FF; ">="smarty.js"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">script&nbsp;</span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text/javascript"</span><span style="color: #0000FF; ">&gt;</span><span style="background-color: #f5f5f5;"><br />&nbsp;&nbsp;&nbsp;&nbsp;$(</span><span style="background-color: #F5F5F5; color: #0000FF; ">function</span><span style="background-color: #f5f5f5;">()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;angular.bootstrap(angular.element(</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">body</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">),&nbsp;[</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">angular-smarty</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;});<br /></span><span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">&gt;</span><br /><span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">html</span><span style="color: #0000FF; ">&gt;</span></div><br /><a href="https://github.com/thumbtack/angular-smarty" target="_blank">https://github.com/thumbtack/angular-smarty</a><img src ="http://www.blogjava.net/paulwong/aggbug/414918.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2014-06-19 09:01 <a href="http://www.blogjava.net/paulwong/archive/2014/06/19/414918.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>浅释ANGULARJS</title><link>http://www.blogjava.net/paulwong/archive/2014/06/08/414508.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Sun, 08 Jun 2014 03:47:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2014/06/08/414508.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/414508.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2014/06/08/414508.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/414508.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/414508.html</trackback:ping><description><![CDATA[<ol>
     <li>导入ANGULARJS库<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     --><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">script&nbsp;</span><span style="color: #FF0000; ">src</span><span style="color: #0000FF; ">="lib/angular/angular.js"</span><span style="color: #0000FF; ">&gt;&lt;/</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">&gt;</span></div>
     <br />
     </li>
     <li>通知ANGULARJS引擎开始工作，并设置作用域<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     --><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">html&nbsp;</span><span style="color: #FF0000; ">ng-app</span><span style="color: #0000FF; ">&gt;</span></div>
     <br />
     </li>
     <li>运行一个CONTROLLER，如果里面有设置模型的数据的，就将模型保存下来，此CONTROLLER仅仅可以存取BODY内的所有数据<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     --><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">body&nbsp;</span><span style="color: #FF0000; ">ng-controller</span><span style="color: #0000FF; ">="PhoneListCtrl"</span><span style="color: #0000FF; ">&gt;</span></div>
     <br />
     </li>
     <li>CONTROLLER代码，其中$scope是ANGULARJS管理的对象，这时就注入到此方法中<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     --><span style="color: #0000FF; ">function</span>&nbsp;PhoneListCtrl($scope)&nbsp;{<br />
     &nbsp;&nbsp;$scope.phones&nbsp;=&nbsp;[<br />
     &nbsp;&nbsp;&nbsp;&nbsp;{"name":&nbsp;"Nexus&nbsp;S",<br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"snippet":&nbsp;"Fast&nbsp;just&nbsp;got&nbsp;faster&nbsp;with&nbsp;Nexus&nbsp;S."},<br />
     &nbsp;&nbsp;&nbsp;&nbsp;{"name":&nbsp;"Motorola&nbsp;XOOM&#8482;&nbsp;with&nbsp;Wi-Fi",<br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"snippet":&nbsp;"The&nbsp;Next,&nbsp;Next&nbsp;Generation&nbsp;tablet."},<br />
     &nbsp;&nbsp;&nbsp;&nbsp;{"name":&nbsp;"MOTOROLA&nbsp;XOOM&#8482;",<br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"snippet":&nbsp;"The&nbsp;Next,&nbsp;Next&nbsp;Generation&nbsp;tablet."}<br />
     &nbsp;&nbsp;];<br />
     }</div>
     <br />
     </li>
     <li>如遇到双大括号的标签，则运行里面的表达式，并将结果更新至DOM显示<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     -->{{phone.name}}</div>
     <br />
     </li>
     <li>根据数组中ITEM的多少，产生相对应的LI标签<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     --><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">ul</span><span style="color: #0000FF; ">&gt;</span><br />
     &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">li&nbsp;</span><span style="color: #FF0000; ">ng-repeat</span><span style="color: #0000FF; ">="phone&nbsp;in&nbsp;phones"</span><span style="color: #0000FF; ">&gt;</span><br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{phone.name}}<br />
     &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">&gt;</span>{{phone.snippet}}<span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">&gt;</span><br />
     &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">li</span><span style="color: #0000FF; ">&gt;</span><br />
     &nbsp;&nbsp;<span style="color: #0000FF; ">&lt;/</span><span style="color: #800000; ">ul</span><span style="color: #0000FF; ">&gt;</span></div>
     <br />
     </li>
     <li>此标签(指令)会将INPUT的VALUE值与一个叫QUERY的对象进行双向绑定，任何一方的改变都会同步至对方<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     --><span style="color: #0000FF; ">&lt;</span><span style="color: #800000; ">input&nbsp;</span><span style="color: #FF0000; ">ng-model</span><span style="color: #0000FF; ">="query"</span><span style="color: #0000FF; ">&gt;</span></div>
     <br />
     </li>
     <li>使用外部数据，$http是ANGULARJS管理的提供HTTP访问服务的对象，$scope.phones是往$scope里面新增一个phones，并赋值<br />
     <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br />
     <br />
     Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
     http://www.CodeHighlighter.com/<br />
     <br />
     --><span style="color: #0000FF; ">function</span>&nbsp;PhoneListCtrl($scope,&nbsp;$http)&nbsp;{<br />
     &nbsp;&nbsp;$http.get('phones/phones.json').success(<span style="color: #0000FF; ">function</span>(data)&nbsp;{<br />
     &nbsp;&nbsp;&nbsp;&nbsp;$scope.phones&nbsp;=&nbsp;data;<br />
     &nbsp;&nbsp;});<br />
     <br />
     }</div>
     <br />
     </li>
</ol><img src ="http://www.blogjava.net/paulwong/aggbug/414508.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2014-06-08 11:47 <a href="http://www.blogjava.net/paulwong/archive/2014/06/08/414508.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ANGULARJS资源</title><link>http://www.blogjava.net/paulwong/archive/2014/06/08/414504.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Sun, 08 Jun 2014 01:38:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2014/06/08/414504.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/414504.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2014/06/08/414504.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/414504.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/414504.html</trackback:ping><description><![CDATA[AngularJS入门教程<br /><a href="http://www.ituring.com.cn/minibook/303" target="_blank">http://www.ituring.com.cn/minibook/303</a><br /><br /><br />AngularJS O'Reilly book<br /><a href="https://github.com/shyamseshadri/angularjs-book" target="_blank">https://github.com/shyamseshadri/angularjs-book</a><br /><br />angular-phonecat<br /><a href="https://github.com/angular/angular-phonecat" target="_blank">https://github.com/angular/angular-phonecat</a><br /><br /><br />教程<br /><a href="http://scotch.io/tutorials" target="_blank">http://scotch.io/tutorials</a><br /><br /><br /><a href="http://my.oschina.net/blogshi/blog?catalog=495077" target="_blank">http://my.oschina.net/blogshi/blog?catalog=495077</a><br /><br /><br />javaee7-angular<br /><a href="https://github.com/radcortez/javaee7-angular" target="_blank">https://github.com/radcortez/javaee7-angular</a><br /><br /><img src ="http://www.blogjava.net/paulwong/aggbug/414504.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2014-06-08 09:38 <a href="http://www.blogjava.net/paulwong/archive/2014/06/08/414504.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>AngularJS 最佳实践</title><link>http://www.blogjava.net/paulwong/archive/2014/06/05/414436.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Thu, 05 Jun 2014 08:18:00 GMT</pubDate><guid>http://www.blogjava.net/paulwong/archive/2014/06/05/414436.html</guid><wfw:comment>http://www.blogjava.net/paulwong/comments/414436.html</wfw:comment><comments>http://www.blogjava.net/paulwong/archive/2014/06/05/414436.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/paulwong/comments/commentRss/414436.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/paulwong/services/trackbacks/414436.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;"><a href="http://angularjs.org/" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">AngularJS</a>&nbsp;是一个 Web 应用框架，它实现了<a href="http://www.lovelucy.info/mvc-in-front-end-web-app-development-based-on-restful-api-design.html" title="基于 RESTful 接口的前端 MVC 架构" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">前端的 MVC 架构</a>，能让开发人员很方便地实现业务逻辑。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">举个栗子，要做到下面的效果，以前可能需要写一连串的 JavaScript 代码绑定 N 多事件。而使用 AngularJS 框架，一句 JavaScript 都不用写就能实现了，神奇吧？<a href="http://jsfiddle.net/mDdKr/2/" title="Try run" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">查看演示</a>。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;"><a href="http://cdn.lovelucy.info/wordpress/wp-content/uploads/2013/06/angularjs-demo.gif" style="margin: 0px; padding: 0px; color: #ed1e24; outline: none; text-decoration: none;"><img src="http://cdn.lovelucy.info/wordpress/wp-content/uploads/2013/06/angularjs-demo.gif" alt="angularjs-demo" width="240" height="110" size-full=""  wp-image-1695"="" style="margin: 0px auto; padding: 0px; border: 0px; display: block;" /></a></p><div style="margin: 0px 0px 1.5em; color: #110000; overflow-y: hidden; overflow-x: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; box-shadow: #999999 3px 3px 3px; -webkit-box-shadow: #999999 3px 3px 3px; width: 644px; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #f9f9f9;"><table style="margin: 0px; padding: 0px; border-collapse: collapse; width: 813px;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border: 0px; vertical-align: top; background-color: #eeeeee;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0.8em; overflow: visible; font-size: 12px; width: auto; border: 1px solid #dddddd; float: none; clear: none; line-height: 1.333; background-color: transparent;">    <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">script</span> <span style="margin: 0px; padding: 0px; color: #000066;">type</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"text/javascript"</span> <span style="margin: 0px; padding: 0px; color: #000066;">src</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"</span>&gt;&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">script</span>&gt;</span>     <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span> data-ng-app&gt;</span>         单价： <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">input</span> <span style="margin: 0px; padding: 0px; color: #000066;">type</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"number"</span> <span style="margin: 0px; padding: 0px; color: #000066;">min</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #cc66cc;">0</span> ng-model<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"price"</span> ng-init<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"price = 299"</span>&gt;</span>         <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">br</span>&gt;</span>         数量： <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">input</span> <span style="margin: 0px; padding: 0px; color: #000066;">type</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"number"</span> <span style="margin: 0px; padding: 0px; color: #000066;">min</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #cc66cc;">0</span> ng-model<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"quantity"</span> ng-init<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"quantity = 1"</span>&gt;</span>         <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">br</span>&gt;</span>         总价： {{ quantity * price }}     <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></tbody></table></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">这得益于 AngularJS 中的双向数据绑定特性(Two Way Data-Binding)，将 Model 和 View 自动关联了起来，在更复杂的业务场景下，还有代码分离的好处，将 DOM 操作和应用逻辑解耦，非常实用。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;"></p><div style="margin: 0px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #ffffff;"><div aligncenter"="" style="margin: 0px auto;"><iframe width="300" height="250" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" id="aswift_0" name="aswift_0" style="margin: 0px; padding: 0px; left: 0px; position: absolute; top: 0px;"></iframe></div></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;"></p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">不过没有银弹，和其他框架一样，AngularJS 也有它的局限。CRUD 类型的操作是它所擅长的，想想看以前写过的管理后台，几乎大部分都是从数据库中读取数据，然后呈现在页面上，进行各种增删改查。AngularJS 约定了一套规范（<a href="http://www.lovelucy.info/convention-over-configuration.html" title="约定优于配置&#8212;&#8212;软件开发的简约原则" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">约定优于配置</a>），于是你可以很便捷地操作数据。而在其他方面，例如开发复杂的 Web 游戏，AngularJS 则是无用武之地了。</p><h2>一、AngularJS 中的精美特性</h2><h3>双向绑定</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">上面的例子已经说明了，我们可以像 PHP Smarty 模板一样在 HTML 中写表达式，用 {{ 和 }} 包起来。在 AngularJS 里，View 和 Model 是在 Controller 里面绑定的，所以无论你在 View 的表单中修改了内容，还是在 Controller 里通过代码修改了 Model 值，两边都会即时发生变化，同步更新。因为 AngularJS 会监控 （watch） Model 对象的变化，随时反映到 View 中。</p><h3>Filter</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">Filter 类似 Unix 里面的 | 管道概念，AngularJS 把它搬到了前端。还是举个例子，你们感受一下&#8212;&#8212;</p><div style="margin: 0px 0px 1.5em; color: #110000; overflow-y: hidden; overflow-x: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; box-shadow: #999999 3px 3px 3px; -webkit-box-shadow: #999999 3px 3px 3px; width: 644px; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #f9f9f9;"><table style="margin: 0px; padding: 0px; border-collapse: collapse; width: 644px;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border: 0px; vertical-align: top; background-color: #eeeeee;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0.8em; overflow: visible; font-size: 12px; width: auto; border: 1px solid #dddddd; float: none; clear: none; line-height: 1.333; background-color: transparent;"><span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span>{{ 9999 | number }}<span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span>{{ 9999+1 | number:2 }}<span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span>{{ 9*9 | currency }}<span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span> <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span>{{ 'Hello World' | uppercase }}<span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></tbody></table></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">输出结果：</p><pre style="padding: 0.8em; overflow: hidden; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; width: 515.1875px; border: 1px solid #dddddd; color: #4e4e4e; line-height: normal; background-color: #ffffff;">9,999 10,000.00 $81.00 HELLO WORLD </pre><h2>二、AngularJS 中的一些&#8220;坑&#8221;</h2><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">由于过去写 JavaScript 的习惯使然，人们很容易掉进一些 AngularJS 的陷阱里。下面的内容假设你已经了解前端 MVC 概念，并对 AngularJS 有了一定经验，初学者读起来可能比较艰深晦涩。</p><h3>DOM 操作</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">避免使用 jQuery 来操作 DOM，包括增加元素节点，移除元素节点，获取元素内容，隐藏或显示元素。你应该使用 directives 来实现这些动作，有必要的话你还要编写自己的 directives。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">如果你感到很难改变习惯，那么考虑从你的网页中移除 jQuery 吧。真的，AngularJS 中的&nbsp;<code style="margin: 0px; padding: 0px;">$http</code>&nbsp;服务非常强大，基本可以替代 jQuery 的 ajax 函数，而且 AngularJS 内嵌了 jQLite &#8212;&#8212; 它内部实现的一个 jQuery 子集，包含了常用的 jQuery DOM 操作方法，事件绑定等等。但这并不是说用了AngularJS 就不能用 jQuery 了。如果你的网页有载入 jQuery 那么 AngularJS 会优先采用你的 jQuery，否则它会 fall back 到 jQLite。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">需要自己编写 directives 的情况通常是当你使用了第三方的 jQuery 插件。因为插件在 AngularJS 之外对表单值进行更改，并不能即时反应到 Model 中。例如我们用得比较多的 jQueryUI&nbsp;<a href="http://jqueryui.com/datepicker/" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">datepicker</a>&nbsp;插件，当你选中一个日期后，插件会将日期字符串填到 input 输入框中。View 改变了，却并没有更新 Model，因为<code style="margin: 0px; padding: 0px;">$('.datepicker').datepicker();</code>&nbsp;这段代码不属于 AngularJS 的管理范围。我们需要编写一个directive 来让 DOM 的改变即时更新到 Model 里。</p><div style="margin: 0px 0px 1.5em; color: #110000; overflow-y: hidden; overflow-x: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; box-shadow: #999999 3px 3px 3px; -webkit-box-shadow: #999999 3px 3px 3px; width: 644px; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #f9f9f9;"><table style="margin: 0px; padding: 0px; border-collapse: collapse; width: 644px;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border: 0px; vertical-align: top; background-color: #eeeeee;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0.8em; overflow: visible; font-size: 12px; width: auto; border: 1px solid #dddddd; float: none; clear: none; line-height: 1.333; background-color: transparent;"><span style="margin: 0px; padding: 0px; color: #000066; font-weight: bold;">var</span> directives <span style="margin: 0px; padding: 0px; color: #339933;">=</span> angular.<span style="margin: 0px; padding: 0px; color: #660066;">module</span><span style="margin: 0px; padding: 0px; color: #009900;">(</span><span style="margin: 0px; padding: 0px; color: #3366cc;">'directives'</span><span style="margin: 0px; padding: 0px; color: #339933;">,</span> <span style="margin: 0px; padding: 0px; color: #009900;">[</span><span style="margin: 0px; padding: 0px; color: #009900;">]</span><span style="margin: 0px; padding: 0px; color: #009900;">)</span><span style="margin: 0px; padding: 0px; color: #339933;">;</span> &nbsp; directives.<span style="margin: 0px; padding: 0px; color: #660066;">directive</span><span style="margin: 0px; padding: 0px; color: #009900;">(</span><span style="margin: 0px; padding: 0px; color: #3366cc;">'datepicker'</span><span style="margin: 0px; padding: 0px; color: #339933;">,</span> <span style="margin: 0px; padding: 0px; color: #000066; font-weight: bold;">function</span><span style="margin: 0px; padding: 0px; color: #009900;">(</span><span style="margin: 0px; padding: 0px; color: #009900;">)</span> <span style="margin: 0px; padding: 0px; color: #009900;">{</span>    <span style="margin: 0px; padding: 0px; color: #000066; font-weight: bold;">return</span> <span style="margin: 0px; padding: 0px; color: #000066; font-weight: bold;">function</span><span style="margin: 0px; padding: 0px; color: #009900;">(</span>scope<span style="margin: 0px; padding: 0px; color: #339933;">,</span> element<span style="margin: 0px; padding: 0px; color: #339933;">,</span> attrs<span style="margin: 0px; padding: 0px; color: #009900;">)</span> <span style="margin: 0px; padding: 0px; color: #009900;">{</span>        element.<span style="margin: 0px; padding: 0px; color: #660066;">datepicker</span><span style="margin: 0px; padding: 0px; color: #009900;">(</span><span style="margin: 0px; padding: 0px; color: #009900;">{</span>            inline<span style="margin: 0px; padding: 0px; color: #339933;">:</span> <span style="margin: 0px; padding: 0px; color: #003366; font-weight: bold;">true</span><span style="margin: 0px; padding: 0px; color: #339933;">,</span>            dateFormat<span style="margin: 0px; padding: 0px; color: #339933;">:</span> <span style="margin: 0px; padding: 0px; color: #3366cc;">'dd.mm.yy'</span><span style="margin: 0px; padding: 0px; color: #339933;">,</span>            onSelect<span style="margin: 0px; padding: 0px; color: #339933;">:</span> <span style="margin: 0px; padding: 0px; color: #000066; font-weight: bold;">function</span><span style="margin: 0px; padding: 0px; color: #009900;">(</span>dateText<span style="margin: 0px; padding: 0px; color: #009900;">)</span> <span style="margin: 0px; padding: 0px; color: #009900;">{</span>                <span style="margin: 0px; padding: 0px; color: #000066; font-weight: bold;">var</span> modelPath <span style="margin: 0px; padding: 0px; color: #339933;">=</span> $<span style="margin: 0px; padding: 0px; color: #009900;">(</span><span style="margin: 0px; padding: 0px; color: #000066; font-weight: bold;">this</span><span style="margin: 0px; padding: 0px; color: #009900;">)</span>.<span style="margin: 0px; padding: 0px; color: #660066;">attr</span><span style="margin: 0px; padding: 0px; color: #009900;">(</span><span style="margin: 0px; padding: 0px; color: #3366cc;">'ng-model'</span><span style="margin: 0px; padding: 0px; color: #009900;">)</span><span style="margin: 0px; padding: 0px; color: #339933;">;</span>                putObject<span style="margin: 0px; padding: 0px; color: #009900;">(</span>modelPath<span style="margin: 0px; padding: 0px; color: #339933;">,</span> scope<span style="margin: 0px; padding: 0px; color: #339933;">,</span> dateText<span style="margin: 0px; padding: 0px; color: #009900;">)</span><span style="margin: 0px; padding: 0px; color: #339933;">;</span>                scope.$apply<span style="margin: 0px; padding: 0px; color: #009900;">(</span><span style="margin: 0px; padding: 0px; color: #009900;">)</span><span style="margin: 0px; padding: 0px; color: #339933;">;</span>            <span style="margin: 0px; padding: 0px; color: #009900;">}</span>        <span style="margin: 0px; padding: 0px; color: #009900;">}</span><span style="margin: 0px; padding: 0px; color: #009900;">)</span><span style="margin: 0px; padding: 0px; color: #339933;">;</span>    <span style="margin: 0px; padding: 0px; color: #009900;">}</span> <span style="margin: 0px; padding: 0px; color: #009900;">}</span><span style="margin: 0px; padding: 0px; color: #009900;">)</span><span style="margin: 0px; padding: 0px; color: #339933;">;</span></pre></td></tr></tbody></table></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">然后在 HTML 中引入这个 direcitve</p><div style="margin: 0px 0px 1.5em; color: #110000; overflow-y: hidden; overflow-x: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; box-shadow: #999999 3px 3px 3px; -webkit-box-shadow: #999999 3px 3px 3px; width: 644px; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #f9f9f9;"><table style="margin: 0px; padding: 0px; border-collapse: collapse; width: 644px;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border: 0px; vertical-align: top; background-color: #eeeeee;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0.8em; overflow: visible; font-size: 12px; width: auto; border: 1px solid #dddddd; float: none; clear: none; line-height: 1.333; background-color: transparent;"><span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">input</span> <span style="margin: 0px; padding: 0px; color: #000066;">type</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"text"</span> datepicker ng-model<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"myObject.myDateValue"</span> <span style="margin: 0px; padding: 0px; color: #66cc66;">/</span>&gt;</span></pre></td></tr></tbody></table></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">说白了 directive 就是在 HTML 里写自定义的标签属性，达到插件的作用。这种声明式的语法扩展了 HTML。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">需要说明的是，有一个&nbsp;<a href="http://angular-ui.github.io/" title="Angular UI" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">AngularUI</a>&nbsp;项目提供了大量的 directive 给我们使用，包括 Bootstrap 框架中的插件以及基于 jQuery 的其他很热门的 UI 组件。我之前说过 AngularJS 的社区很活跃嘛，生态系统健全。</p><h3>ngOption 中的 value</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">这是个大坑。如果你去查看 ngOption 生成的&nbsp;<code style="margin: 0px; padding: 0px;">&lt;select&gt;</code>&nbsp;中的&nbsp;<code style="margin: 0px; padding: 0px;">&lt;option&gt;</code>&nbsp;的选项值（每个&nbsp;<code style="margin: 0px; padding: 0px;">&lt;option value="xxx"&gt;</code>&nbsp;的 value 部分），那绝对是枉费心机。因为这里的值永远都会是 AngularJS 内部元素的索引，并不是你所指定的表单选项值。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">还是要转变观念，AngularJS 已经不再用表单进行数据交互了，而是用 Model。使用 $http 来提交 Model，在 php 中则使用&nbsp;<code style="margin: 0px; padding: 0px;">file_get_contents('php://input')</code>&nbsp;来获取前端提交的数据。</p><h3>{{ }} 的问题</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">在页面初始化的时候，用户可能会看到 {{ }}，然后闪烁一下才出现真正的内容。<br style="margin: 0px; padding: 0px;" />解决办法：</p><ol style="margin: 0.4em 0px 1em; padding: 0px; line-height: 19.5px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; background-color: #ffffff;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">使用 ng-cloak directive 来隐藏它</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">使用 ng-bind 替代 {{ }}</li></ol><h3>将界面与业务逻辑分离</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">Controller 不应该直接引用 DOM，而应该控制 view 的行为。例如&#8220;如果用户操作了 X，应该发生什么事情&#8221;，&#8220;我从哪里可以获得 X？&#8221;</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">Service 在大部分情况下也不应该直接引用 DOM，它应该是一个单例（singletons），独立于界面，与 view 的逻辑无关。它的角色只是&#8220;做 X 操作&#8221;。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">DOM 操作应该放在 directives 里面。</p><h3>尽量复用已有功能</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">你所写的功能很可能 AngularJS 已经实现了，有一些代码是可以抽象出来复用的，使用更 Angular 的方式。总之就是很多 jQuery 的繁琐代码可以被替代。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">1.&nbsp;<code style="margin: 0px; padding: 0px;">ng-repeat</code></strong></p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">ng-repeat 很有用。当 Ajax 从服务器获得数据后，我们经常使用 jQuery （比如上面讲过的例子） 向某些 HTML 容器节点中添加更多的元素，这在 AngularJS 里是不好的做法。有了 ng-repeat 一切就变得非常简单了。在你的 $scope 中定义一个数组 （model） 来保存从服务器拉取的数据，然后使用 ng-repeat 将它与 DOM 绑定即可。下面的例子初始化定义了 friends 这个 model</p><div style="margin: 0px 0px 1.5em; color: #110000; overflow-y: hidden; overflow-x: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; box-shadow: #999999 3px 3px 3px; -webkit-box-shadow: #999999 3px 3px 3px; width: 644px; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #f9f9f9;"><table style="margin: 0px; padding: 0px; border-collapse: collapse; width: 644px;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border: 0px; vertical-align: top; background-color: #eeeeee;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0.8em; overflow: visible; font-size: 12px; width: auto; border: 1px solid #dddddd; float: none; clear: none; line-height: 1.333; background-color: transparent;"><span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span> ng-init<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"friends = [{name:'John', age:25}, {name:'Mary', age:28}]"</span>&gt;</span>     I have {{friends.length}} friends. They are:     <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">ul</span>&gt;</span>         <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">li</span> ng-repeat<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"friend in friends"</span>&gt;</span>             [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.         <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">li</span>&gt;</span>     <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">ul</span>&gt;</span> <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></tbody></table></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">显示结果</p><pre style="padding: 0.8em; overflow: hidden; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; width: 515.1875px; border: 1px solid #dddddd; color: #4e4e4e; line-height: normal; background-color: #ffffff;">I have 2 friends. They are:   [1] John who is 25 years old.   [2] Mary who is 28 years old. </pre><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">2.&nbsp;<code style="margin: 0px; padding: 0px;">ng-show</code></strong></p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">ng-show 也很有用。使用 jQuery 来根据条件控制界面元素的显示隐藏，这很常见。但是 Angular 有更好的方式来做到这一点。ng-show （以及 ng-hide） 可以根据布尔表达式来决定隐藏和显示。在 $scope 中定义一个变量：</p><div style="margin: 0px 0px 1.5em; color: #110000; overflow-y: hidden; overflow-x: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; box-shadow: #999999 3px 3px 3px; -webkit-box-shadow: #999999 3px 3px 3px; width: 644px; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #f9f9f9;"><table style="margin: 0px; padding: 0px; border-collapse: collapse; width: 644px;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border: 0px; vertical-align: top; background-color: #eeeeee;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0.8em; overflow: visible; font-size: 12px; width: auto; border: 1px solid #dddddd; float: none; clear: none; line-height: 1.333; background-color: transparent;"><span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span> ng-show<span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"!loggedIn"</span>&gt;</span>     点击 <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">a</span> <span style="margin: 0px; padding: 0px; color: #000066;">href</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"#/login"</span>&gt;</span>这里<span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">a</span>&gt;</span> 登录 <span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></tbody></table></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">类似的内置 directives 还有 ng-disabled， ng-switch 等等，用于条件控制，语法简洁，都很强大。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;"><strong style="margin: 0px; padding: 0px;">3.&nbsp;<code style="margin: 0px; padding: 0px;">ng-class</code></strong></p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">ng-class 用于条件性地给元素添加 class，以前我们也经常用 jQuery 来实现。Angular 中的 ng-class 当然更好用了，例子：</p><div style="margin: 0px 0px 1.5em; color: #110000; overflow-y: hidden; overflow-x: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; box-shadow: #999999 3px 3px 3px; -webkit-box-shadow: #999999 3px 3px 3px; width: 644px; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: normal; background-color: #f9f9f9;"><table style="margin: 0px; padding: 0px; border-collapse: collapse; width: 771px;"><tbody style="margin: 0px; padding: 0px;"><tr style="margin: 0px; padding: 0px;"><td style="margin: 0px; padding: 0px; border: 0px; vertical-align: top; background-color: #eeeeee;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0.8em; overflow: visible; font-size: 12px; width: auto; border: 1px solid #dddddd; float: none; clear: none; line-height: 1.333; background-color: transparent;"><span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span> ng-<span style="margin: 0px; padding: 0px; color: #000066;">class</span><span style="margin: 0px; padding: 0px; color: #66cc66;">=</span><span style="margin: 0px; padding: 0px; color: #ff0000;">"{ errorClass: isError, warningClass: isWarning, okClass: !isError &amp;&amp; !isWarning }"</span>&gt;</span>...<span style="margin: 0px; padding: 0px; color: #009900;">&lt;<span style="margin: 0px; padding: 0px; color: #66cc66;">/</span><span style="margin: 0px; padding: 0px; color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></tbody></table></div><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">在这里 ng-class 接受一个 object 对象，key 为 CSS class 名，值为 $scope 变量控制的条件表达式，其他类似的内置 directives 还有 ng-class-even 和 ng-class-odd，很实用。</p><h3>$watch 和 $apply</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">AngularJS 的双向数据绑定是最令人兴奋的特性了，然而它也不是全能的魔法，在某些情况下你需要做一些小小的修正。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">当你使用 ng-model， ng-repeat 等等来绑定一个元素的值时， AngularJS 为那个值创建了一个 $watch，只要这个值在 AngularJS 的范围内有任何改变，所有的地方都会同步更新。而你在写自定义的 directive 时，你需要定义你自己的 $watch 来实现这种自动同步。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">有时候你在代码中改变了 model 的值，view 却没有更新，这在自定义事件绑定中经常遇到。这时你就需要手动调用 scope.$apply() 来触发界面更新。上面 datepicker 的例子已经说明了这一点。第三方插件可能会有 call back，我们也可以把回调函数写成匿名函数作为参数传入$apply()中。</p><h3>将 ng-repeat 和其他 directives 结合起来</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">ng-repeat 很有用，不过它和 DOM 绑定了，很难在同一个元素上使用其他 directives （比如 ng-show， ng-controller 等等）。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">如果你想对整个循环使用某个 directive，你可以在 repeat 外再包一层父元素把 directive 写在那儿；如果你想对循环内部的每一个元素使用某个 directive，那么把它放到 ng-repeat 的一个子节点上即可。</p><h3>Scope</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">Scope 在 templates 模板中应该是 read-only 的，而在 controller 里应该是 write-only 的。Scope 的目的是引用 model，而不是成为 model。model 就是我们定义的 JavaScript 对象。</p><h3>$rootScope 是可以用的，不过很可能被滥用</h3><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">Scopes 在 AngularJS 中形成一定的层级关系，树状结构必然有一个根节点。通常我们用不到它，因为几乎每个 view 都有一个 controller 以及相对应的自己的 scope。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">但偶尔有一些数据我们希望全局应用在整个 app 中，这时我们可以将数据注入 $rootScope。因为其他 scope 都会继承 root scope，所以那些注入的数据对于 ng-show 这类 directive 都是可用的，就像是在本地 $scope 中的变量一样。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">当然，全局变量是邪恶的，你必须很小心地使用 $rootScope。特别是不要用于代码，而仅仅用于注入数据。如果你非常希望在 $rootScope 写一个函数，那最好把它写到 service 里，这样只有用到的时候它才会被注入，测试起来也方便些。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">相反，如果一个函数的功能仅仅是存储和返回一些数据，就不要把它创建成一个 service。</p><h2>三、AngularJS 项目的目录结构</h2><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">怎样组织代码文件和目录？这恐怕是初学者一开始就会遇到的问题。AngularJS 应用开发的官方入门项目<a href="https://github.com/angular/angular-seed" title="Angular Seed" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">angular-seed</a>，其文件结构是这样的：</p><ul style="margin: 0.4em 0px 1em; padding: 0px; line-height: 19.5px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; background-color: #ffffff;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">css/</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">img/</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">js/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">app.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">controllers.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">directives.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">filters.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">services.js</li></ul></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">lib/</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">partials/</li></ul><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">这种结构对于一个简单的单页 app 来说是可行的，只是一旦代码中存在多个 Controller 或者 Service，就很难找到想要寻找的对象了。我们可以对文件按照业务逻辑进行拆分，就像下面这样：</p><ul style="margin: 0.4em 0px 1em; padding: 0px; line-height: 19.5px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; background-color: #ffffff;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">controllers/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">LoginController.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">RegistrationController.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">ProductDetailController.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">SearchResultsController.js</li></ul></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">directives.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">filters.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">models/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">CartModel.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">ProductModel.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">SearchResultsModel.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">UserModel.js</li></ul></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">services/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">CartService.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">UserService.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">ProductService.js</li></ul></li></ul><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">这种结构把不同的业务功能拆分为独立的文件，条理清晰，但是仍有一定的局限性。最大的问题是一个业务功能的代码分布在controllers, models, servers 三个不同目录下，要从中挑出正确的文件，建立起代码关联，还是有些麻烦。按照功能进行模块化划分目录结构，应该要更为合理一些：</p><ul style="margin: 0.4em 0px 1em; padding: 0px; line-height: 19.5px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; background-color: #ffffff;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">cart/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">CartModel.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">CartService.js</li></ul></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">common/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">directives.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">filters.js</li></ul></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">product/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">search/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">SearchResultsController.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">SearchResultsModel.js</li></ul></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">ProductDetailController.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">ProductModel.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">ProductService.js</li></ul></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">user/<ul style="margin: 0.4em 0px 1em; padding: 0px;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">LoginController.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">RegistrationController.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">UserModel.js</li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;">UserService.js</li></ul></li></ul><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">这样也是适合 RequireJS 等模块加载器的自然直观的代码组织方式。</p><p style="margin: 0px 0px 0.8em; padding: 0px; line-height: 24.309999465942383px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; background-color: #ffffff;">参考链接：</p><ul style="margin: 0.4em 0px 1em; padding: 0px; line-height: 19.5px; color: #4e4e4e; font-family: 'Segoe UI', Calibri, 'Myriad Pro', Myriad, 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; background-color: #ffffff;"><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;"><a href="http://www.youtube.com/watch?v=ZhfUv0spHCY" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">AngularJS Best Practices 视频(Youtube)</a></li><li style="margin: 0px 0px 0px 2.5em; padding: 0px; list-style-position: outside;"><a href="http://blog.miniasp.com/post/2013/04/24/Front-end-Engineering-Fineart-An-Introduction-to-AngularJS.aspx" target="_blank" style="margin: 0px; padding: 0px; color: #0071bb; outline: none;">前端工程的極致精品： AngularJS 開發框架介紹</a></li></ul><img src ="http://www.blogjava.net/paulwong/aggbug/414436.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/paulwong/" target="_blank">paulwong</a> 2014-06-05 16:18 <a href="http://www.blogjava.net/paulwong/archive/2014/06/05/414436.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>