0

I would to declare specific module because I load on every page all my angular files.. It's huge. I want to load specifically angular files on each page.

My app.js file that looks like this :

var testApp = angular.module(
'testApp', [
    'MainCtrl',
    'AdminCtrl',
    'UserCtrl',
    'ArticleCtrl',
    'ArticleService', 
    'MediaService',
    'UserService',
],
function($interpolateProvider) {
    $interpolateProvider.startSymbol('[[');
    $interpolateProvider.endSymbol(']]');
}
);

But it wants to declare modules that are no longer loaded. So instead of making a specific app.js for each page I need..

Anyone has a better idea ?

Thank you.

1 Answer 1

1

You can make use of requirejs where modules will be loaded on demand.

A very nice tutorial how to achieve this:

Lazy loading angular components

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.