GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I noticed on the google group I'm one of many integrating Angular with RequireJS. Are you guys open to the idea of adopting the AMD standard for Angular's internals? Something I love about Angular is it's all about using future web technology today. AMD is today's solution for the upcoming ES6 modules. Adopting RequireJS/AMD would bring the following benefits to projects using Angular:
Downside is RequireJS adds 15k, but post-build can use require's 1k almond.js shim if necessary. Worth it IMO.
If you're open to this I'm happy to take this on and submit a pull request.
It would be very cool
This question comes up often. While the two use the same terminology, they are not the same thing. AMD talks about how to load individual script files into the browser. Angular modules talk about how the application should be assembled. You can only run AMD once on script load, where as you can run angular modules over and over, for example in tests. AMD is higher level it assembles the codebase, angular injector assembles the application.
There is no reason why you can't use AMD with angular today, and I know that some people already have it working in this way.
@mhevery the intent of this issue was for Angular itself to be refactored to take advantage of AMD internally, which would add even more awesome benefits to Angular (see above). Are you open to considering this?
Being able to load resources asynchronously when needed rather than all at once is definitely a good way to go for building none-trivial apps. I like the approach taken here: https://github.com/matys84pl/angularjs-requirejs-lazy-controllers
I have opened a related issue for those who are interested: #2078