>
> May I ask what problems you are solving with RequireJS and putting each
> file in its own Angular module? Even 170 source files could be bundled,
> minimized, compressed, and loaded up front, don't you think? And why so
> many modules? I'm just being curious.
>
Sure! We *are* bundling and minifying. We have 4 entry points (and 4 entry
point JS bundles), a "frameworks" bundle, and a "heavy feature we need to
lazy-load" bundle.
We see Angular modules as boilerplate/overhead. We had started with
"everything attaches itself to the 'MainApp' module" pattern and that
worked until we needed to make another separate app (Admin section) where
we needed to reuse some pieces from the main app. So having everything
attach itself to the 'MainApp' module just didn't work for us anymore
because it would require the 'Admin' module to depend on 'MainApp' and thus
needlessly load *all* MainApp's dependencies.
So we started having each JS module define its own Angular module,
returning the module name, and using the 'angular.module(module.id,
[require('controllers/SomeController'), ...])' pattern.
Adam
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.