HaoJu Zheng
HaoJu Zheng
@AcarMeel you can use this ui-switch https://github.com/hjzheng/angular-switch
you can try this: https://github.com/hjzheng/angular-switch
@Treri 和 @henryzp 推荐使用 https://github.com/typicode/husky , 目前我们团队使用这个, 另外在推荐一个 commitizen 设置提交模板很方便,自己定制一下。参见[PPT](https://github.com/ShuyunXIANFESchool/newcomer/tree/master/src/others)
@Treri 是的 但是 commitizen 这个东西也可以自己定制,也很方便 我们自己定制的 https://github.com/ShuyunXIANFESchool/shuyun-cz-conventional-changelog
@ chinfeng 非常同意你的观点。 楼主是误解了angular1.x的module,翻了一下官方的doc https://docs.angularjs.org/guide/module。 第二,关于相同名字service在不同模块中会覆盖,这个是与其依赖注入(DI)设计有关的。 当然楼主的担心是正确的,随着项目变的庞大,它就不能满足大家的期望了,庆幸的是angular团队及时果断的推出2.0
@xufei 又读了一遍,理解,是一种预期。其实你遇到的问题,相信大家也都遇到过,但是没有像你一样总结思考出来,所以感谢啊!关于楼主所提到的问题,有个ng-conf的视频,中间有一段提到说是Angular1.x的DI module的缺点: https://www.youtube.com/watch?v=_OGGsf1ZXMs&index=1&list=PLw5h0DiJ-9PB-vLe3vaNFLG-cTw0Wo7fw > Isn’t the current DI in ng 1.2 good enough? It is, but I believe we can make it better. > It has issues: > •...
#### reslove 配置 1. 路由中 [配置 reslove以及它的好处](https://github.com/johnpapa/angular-styleguide/blob/master/a1/i18n/zh-CN.md#route-resolve-promises) 2. 举例: ``` js $stateProvider .state('home', { url: '/home', templateUrl: './partials/home.html', controller: 'HomeController', controllerAs: 'vm', resolve: { restaurants: function($http) { // 注意这里可以注入服务 return...
@silence717 module.exports 这个是CommonJS的规范 export 是 ES6 的规范吧!exports 不清楚
关于decorator模式原生JS的写法 主要利用了Function对象的apply方法,对原有方法进行了劫持,从而给方法添加新的功能 ``` var decorateFun = function(fun, before, after) { var Decorator = function() { var args = arguments,result,i; if (before && typeof before == 'function') { // 前置方法可对参数进行修改 args...
AngularJS 的 $provide.decorator 可以装饰 provider 吗?