Does AngularJS support AMD like RequireJS?

Problem

In this repo AngularJS is implimented with RequireJS for AMD.

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

  • Am I thinking about this the wrong way — I.E. are they solving different problems?
  • Does the AngularJS libary support AMD now where it had not once before?
  • Is it no longer necessary to use RequireJS with AngularJS projects?

Problem courtesy of: Dan Kanze

Solution

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.

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;dr I haven’t found a compelling reason to use AMD with Angular.js.

Solution courtesy of: Nick Heiner

View additional discussion.