I'm too new to Angular to know if there are any disadvantages to using RequireJS modules instead of Angular's module API (factory(), controller(), filter() etc). Other than easier mocks?
Thanks Cary, that's quite helpful. What's still bothering me is that now I have two envelopes around my code (one for require, one for angular), and they do almost the same thing. That and I'm used to writing anonymous modules with require, where with Angular I have to explicitly name everything :(
Anyway, thanks for the comments everybody. I think if Angular does eventually support module loading it should provide a lightweight one that is easily replaceable with a more robust loaded like requirejs.
I'll post more findings as I integrate these two awesome tools.
My goal was not to have something as complete as requirejs, it was to have something less complete :) I wanted to re-use the dependencies I'm already defining in angular and there are other tools for other concerns addressed by requirejs like resource (js & css) optimization for example. Also, yepnope is all about async resource loading (not just js either).
Maybe I made it sound complicated but using this is quite simple and DRY. It will also allow me to have a prod/dev mode to my app where optimized resources are loaded in prod and unmerged/not optimized files are used in dev.
Anyway, I'm not discrediting your choice of requirejs and encourage people to use it if it fits their needs. AMD's a very well conceived standard and I agree that if module loading comes to Angular it should be easily replaceable (I'm not worried about that, angular's very well designed). I just hope my solution can help someone else looking for a lightweight solution to modular resource loading (only).