什么是角loader.js呢? [英] What is angular-loader.js for?

查看:258
本文介绍了什么是角loader.js呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了谷歌组类似的问题,也是在这里#2。这两次的问题不好回答。该文件中的code并不能使它究竟它做什么以及如何使用它非常清楚。此外,它不是从角文档清晰。

I saw a similar question on the Google groups and also here on Stackoverflow. Both times the question was not answered. The code in this file doesn't make it very clear about what exactly it does and how it is used. Also it's not clear from the Angular documentation.

有人能解释这是怎么使用的。也可以这样用Require.js一起使用?

Can someone explain how this is used. Also can this be used along with Require.js?

推荐答案

角装载机让你的角度脚本以任何顺序加载。

Angular loader lets your angular scripts to be loaded in any order.

由于角种子工程向我们展示了 ,角装载机没有任何特定的API,你只要把它放在你的索引文件的顶部(所以,它的第一个执行),比仍要继续加载你的应用程序文件,你preFER。

As angular-seed project shows us, Angular loader does not have any specific api, you just put it on top of your index file (so that it's executed first) and than proceed to load you application files anyway you prefer.

但是,对于您的使用情况下,最重要的是,你并不真正需要的角度装载机在所有。 RequireJS还可以让你的文件以任意顺序加载,但它也为您提供了角装载机只是不发等诸多功能。

But, the most important thing for your use case is that you don't really need angular loader at all. RequireJS also lets your files to be loaded in any order, but it also provides you with many other features that angular loader just isn't made for.

所以,是的,你可能会RequireJS使用它,但因为它变得多余,你不需要,

So, yes, you may use it with RequireJS, but you don't need to, 'cause it becomes redundant.

这篇关于什么是角loader.js呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆