seajs如何与angularJS集成起来? #1022

Open
ch-hui opened this Issue Nov 19, 2013 · 11 comments

Comments

Projects
None yet
8 participants
@ch-hui

ch-hui commented Nov 19, 2013

项目中想要用seajs作为模块加载器来管理系统中的各个JS模块,同时也能正常使用angularJS,应该怎么做呢?

@afc163

This comment has been minimized.

Show comment Hide comment
@edokeh

This comment has been minimized.

Show comment Hide comment
@edokeh

edokeh Nov 21, 2013

Contributor

正好有人问,那就说说近况
之前与 @atian25 探讨过 route 改变时动态加载代码的问题,不过我的思路跟他不太一样,我想要能实现模块的异步加载,不过现在的 angular 还没法支持,所以临时用“伪模块”的概念来实现

刚巧,最近发现了一个 RequireJS 的库,与我的思路不谋而合,准备仔细研究下
https://github.com/nikospara/angular-require-lazy

Contributor

edokeh commented Nov 21, 2013

正好有人问,那就说说近况
之前与 @atian25 探讨过 route 改变时动态加载代码的问题,不过我的思路跟他不太一样,我想要能实现模块的异步加载,不过现在的 angular 还没法支持,所以临时用“伪模块”的概念来实现

刚巧,最近发现了一个 RequireJS 的库,与我的思路不谋而合,准备仔细研究下
https://github.com/nikospara/angular-require-lazy

@popomore

This comment has been minimized.

Show comment Hide comment
@popomore

popomore Jan 24, 2014

Owner

这个问题问的还挺多的,有时间出个文档。

Owner

popomore commented Jan 24, 2014

这个问题问的还挺多的,有时间出个文档。

@xufei

This comment has been minimized.

Show comment Hide comment
@xufei

xufei Jan 25, 2014

用angular的时候,不需要模块加载器,只要文件加载器的功能即可,相当于把seajs退化了用。angular自身已经有模块机制,如果再包一层很折腾

xufei commented Jan 25, 2014

用angular的时候,不需要模块加载器,只要文件加载器的功能即可,相当于把seajs退化了用。angular自身已经有模块机制,如果再包一层很折腾

@edokeh

This comment has been minimized.

Show comment Hide comment
@edokeh

edokeh Jan 25, 2014

Contributor

@xufei
是很折腾,两者其实挺多概念上的冲突

Contributor

edokeh commented Jan 25, 2014

@xufei
是很折腾,两者其实挺多概念上的冲突

@atian25

This comment has been minimized.

Show comment Hide comment
@atian25

atian25 Jan 26, 2014

@edokeh :
汇报下最近的进度吧, http://blog.getelementsbyidea.com/load-a-module-on-demand-with-angularjs/
这个已经实现了模块级的加载。
主要思路是模拟和重新ng的加载过程。

@xufei:
实践中我们也是基本上用sea来做文件加载器,所以也是挺纠结的。

atian25 commented Jan 26, 2014

@edokeh :
汇报下最近的进度吧, http://blog.getelementsbyidea.com/load-a-module-on-demand-with-angularjs/
这个已经实现了模块级的加载。
主要思路是模拟和重新ng的加载过程。

@xufei:
实践中我们也是基本上用sea来做文件加载器,所以也是挺纠结的。

@edokeh

This comment has been minimized.

Show comment Hide comment
@edokeh

edokeh Jan 26, 2014

Contributor

@atian25
嘿嘿,我也有个差不多成型的方案了,参见 https://github.com/edokeh/klog2/tree/master/app/assets/javascripts/admin
过完春节我来研究下你的

Contributor

edokeh commented Jan 26, 2014

@atian25
嘿嘿,我也有个差不多成型的方案了,参见 https://github.com/edokeh/klog2/tree/master/app/assets/javascripts/admin
过完春节我来研究下你的

@flappymonkey

This comment has been minimized.

Show comment Hide comment
@flappymonkey

flappymonkey Apr 30, 2014

这里有很不错的解决方案,兼容seajs和requirejs
https://github.com/ckken/angular-lazyload

这里有很不错的解决方案,兼容seajs和requirejs
https://github.com/ckken/angular-lazyload

@atian25

This comment has been minimized.

Show comment Hide comment
@atian25

atian25 Apr 30, 2014

@flappymonkey

0_0

如果你仔细看下, 会发现:

ckken/angular-lazyload forked from atian25/angular-lazyload

你发的链接是fork我的 https://github.com/atian25/angular-lazyload

atian25 commented Apr 30, 2014

@flappymonkey

0_0

如果你仔细看下, 会发现:

ckken/angular-lazyload forked from atian25/angular-lazyload

你发的链接是fork我的 https://github.com/atian25/angular-lazyload

@flappymonkey

This comment has been minimized.

Show comment Hide comment
@flappymonkey

flappymonkey May 2, 2014

@atian25
哈哈,当时没看这么仔细,sorry

@atian25
哈哈,当时没看这么仔细,sorry

@lichunqiang

This comment has been minimized.

Show comment Hide comment
@lichunqiang

lichunqiang Sep 5, 2014

文档快到碗里来 @popomore

文档快到碗里来 @popomore

@afc163 afc163 added question and removed documentation labels Oct 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment