是否AngularJS支持AMD样RequireJS? [英] Does AngularJS support AMD like RequireJS?

查看:295
本文介绍了是否AngularJS支持AMD样RequireJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在<一个href=\"https://github.com/addyosmani/todomvc/tree/gh-pages/labs/dependency-examples/angularjs_require\">this回购 AngularJS的形式实现,以RequireJS为AMD。

In this repo AngularJS is implimented with RequireJS for AMD.

此回购 的AngularJS种子球队与AMD的AngularJS项目的的包括RequireJS。

In this repo the AngularJS team seeds an AngularJS project with AMD that does not include RequireJS.


  • 我在想关于这个错误的方式 - I.E.他们在解决不同的问题?

  • 是否AngularJS libary支持AMD现在在哪里它没有前一次?

  • 是不是不再需要使用带有AngularJS项目RequireJS?

推荐答案

是的,你可以使用具有角RequireJS。你需要做一些额外的工作,使之功能,如包括你的链接,但它是可能的。

Yes, you can use RequireJS with angular. You need to do a bit of extra work to make it function, as in the link you included, but it's possible.

在一般情况下,虽然,我还没有发现任何需要与AMD角。 AMD的整体思路是,它可以让你的脚本之间声明的方式指定的依赖关系,而不是担心在其中包括它们在页面上的顺序。然而,角需要照顾,对你的依赖注入机制,所以你没有真正最重要的是采用AMD得到任何好处。

In general, though, I haven't found any need for AMD with Angular. The whole idea of AMD is that it allows you to declaratively specify the dependencies between your scripts and not worry about the order in which you include them on the page. However, Angular takes care of that for you with its dependency injection mechanism, so you're not really getting any benefit by using AMD on top of that.

TL;博士我还没有找到一个令人信服的理由使用AMD与Angular.js

tl;dr I haven't found a compelling reason to use AMD with Angular.js.

这篇关于是否AngularJS支持AMD样RequireJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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