随笔分类 -  AngularJS学习笔记

关于AngularJS的学习笔记
摘要:先对自定义Directive有一个大体的映像myModule.directive('myDirective',function(injectables){ var directiveDefinitionObject={ restrict:string, priori... 阅读全文
posted @ 2014-12-18 20:10 502280728 阅读(308) 评论(0) 推荐(0)
摘要:页面导航 过去,一个URL代表一个页面。但是随着Ajax的兴起,情况发生的很大的变化。不同的内容可以使用同一个URL。这让浏览器中的回退、前进甚至收藏按钮都失去了作用。而AngularJS提供了一套解决方案能够避免这种情况。 怎么解决,有一个小技巧:浏览器不会因为URL中#符号后面的值改变而重新请... 阅读全文
posted @ 2014-12-10 08:26 502280728 阅读(482) 评论(0) 推荐(0)
摘要:AngularJS 表单 AngularJS使用了MVX的结构,我们可以是传统的表单更加强大。比如过去我们得自己写一大堆验证,比过过去我们得自己转换用户的输入,现在这些工作全部可以交给AngularJS. 我们唯一要关心的就是model中的值。在AngularJS中 ,form和input其实也是... 阅读全文
posted @ 2014-12-08 19:08 502280728 阅读(265) 评论(0) 推荐(0)
摘要:FiltersAngularJS provides fileters to transfrom data from one kind to another . For example: {{user.birthday | date:'yyyy-MM-dd'}}In this example, th... 阅读全文
posted @ 2014-12-05 10:10 502280728 阅读(203) 评论(0) 推荐(0)
摘要:DirectivesIn AngularJS, we can use a variety of naming conventions to reference directives .In the AngularJS documentation, all the directive are ind... 阅读全文
posted @ 2014-12-05 10:09 502280728 阅读(234) 评论(0) 推荐(0)
摘要:Overcomming same-origin policy restrictions with JSONP.AJAX has a restriction that it can only retrieve data from the same resource.There are several... 阅读全文
posted @ 2014-12-05 10:08 502280728 阅读(193) 评论(0) 推荐(0)
摘要:AngularJS内置了$http这个服务来与后台联系。(默认会把接受到的数据转换为json)当然,还有一个$resource来提供与RESTful后台联系的服务。$http服务 $http比较简单,下面是$http的常规用法 $http.get(url,[config]) .success(fun... 阅读全文
posted @ 2014-12-05 10:07 502280728 阅读(282) 评论(0) 推荐(0)
摘要:Angular does an excellent job of managing object dependencies. it can even take care of module dependencies.So we can easily group releated services ... 阅读全文
posted @ 2014-11-16 17:54 502280728 阅读(191) 评论(0) 推荐(0)
摘要:有以下5中方法注册一个AngularJS可以识别的Servicevalue和constant是两个极其简单的方法,只有少数情况下会使用。 service已经开始复杂了起来。而factory是我认为既简单又有足够灵活的度的方法。最后的provide是最复杂的方法,其他方法都是provide的特殊情况下... 阅读全文
posted @ 2014-11-16 17:53 502280728 阅读(426) 评论(0) 推荐(0)
摘要:I am still tired to translate these into Chinese.but who cares? i write these posts just for myselfViewafter a browser is done transforming the arkup'... 阅读全文
posted @ 2014-11-16 17:51 502280728 阅读(190) 评论(0) 推荐(0)
摘要:I am tired to translate these into Chinese.but who cares? i write these posts just for myselfScopea new scope is created by the ng-controller directiv... 阅读全文
posted @ 2014-11-16 17:49 502280728 阅读(145) 评论(0) 推荐(0)