在实际业务中经常需要等待几个请求完成后再进行下一步操作。但angularjs中$http不支持同步的请求。解决方法一:$http.get('url1').success(function (d1) { $http.get('url2').success(function (d2) { ...
分类:
Web程序 时间:
2015-01-05 23:18:55
阅读次数:
856
在Angular的原生指令中有这几个指令用来控制元素的展示与否,ng-show/ng-hide/ng-if和ng-switch。在angular性能优化中,我们也常常会用到它。
分类:
Web程序 时间:
2015-01-05 21:40:01
阅读次数:
1527
本片文章是使用了angularjs 中使用 service 在controller 之间 share 对象和数据的code(http://jsfiddle.net/kn46u0uj/1/) 来进行演示Factory,Service,Provider 之间的区别1. Factoryfactory('d...
分类:
Web程序 时间:
2015-01-05 18:11:56
阅读次数:
176
在做angularjs 的UI 时,我们经常会遇到一个页面之间有几个controller,在controller 之间share 公共的一些数据和方法就变得比较困难,目前推荐的做法是使用创建一个service, 在service 中存储公共的数据,然后把service 注入到controller中来...
分类:
Web程序 时间:
2015-01-05 16:15:57
阅读次数:
165
在项目开发时,全局scope 和 directive本地scope使用范围不够清晰,全局scope与directive本地scope通信掌握的不够透视,这里对全局scope 和 directive本地scope的使用做一个总结
分类:
Web程序 时间:
2015-01-04 21:03:27
阅读次数:
192
系统学习JS,从《JavaScript高级程序设计》入门,通过学习jQuery或者angularJS源码来进阶。第1章 JavaScript简介1.JS问世的目的是处理以前由服务器端语言(如Perl)负责的一些输入验证操作,由Netscape主导开发,那时候微软的IE还不能独领风骚。最初叫做Live...
分类:
编程语言 时间:
2015-01-04 19:08:32
阅读次数:
305
angular的MVVM框架结构: 1. app,2.routes, config,3.module,4.Controller, $scope,controller参数,事件机制。5.Model, Service, factory, ui-router, provider (stateprovide...
分类:
Web程序 时间:
2015-01-04 16:41:28
阅读次数:
144
With theocLazyLoadyou can load AngularJS modules on demand. This is very handy for runtime loading of Angular modules in large applications.'use stric...
分类:
Web程序 时间:
2015-01-04 06:25:30
阅读次数:
1062
ui-router's states and AngularJS directives have much in common. Let's explores the similarities between the two and how these patterns have emerged i...
分类:
Web程序 时间:
2015-01-04 06:25:08
阅读次数:
216
We'velooked at lazy loading with ocLazyLoadpreviously, but what if we are using ui-router and want to lazy load modules when we change states?angular....
分类:
Web程序 时间:
2015-01-04 06:24:36
阅读次数:
1221