Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Resolve without moduleResolves breaks on AngularJS >=1.3.0-rc.1 #20

@jeffsheets

Description

@jeffsheets

I'm using deferredBootstrapper with a resolve block, but not a moduleResolves block, like this:

window.deferredBootstrapper.bootstrap({
        element: window.document.body,
        module: 'main',
        injectorModules: ['bootstrapper.service'],
        resolve: {
            AppProps: ['bootstrapperService', function (bootstrapperService) {
                return bootstrapperService.getAppProps();
            }]
        }
    });

After upgrading to AngularJS 1.3.0-rc.1 the app fails to load with an error like:
Error: [$injector:nomod] Module '{"AppProps":["bootstrapperService",null]}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

After some debugging it appears this commit to angular that added a parameter to the forEach loop is the cause of the bug: angular/angular.js@df9e60c

In any case, a valid workaround appears to be using a moduleResolves and specifying your main module, like this:

window.deferredBootstrapper.bootstrap({
        element: window.document.body,
        module: 'main',
        injectorModules: ['bootstrapper.service'],
        moduleResolves: [
            {
                module: 'main',
                resolve: {
                    AppProps: ['bootstrapperService', function (bootstrapperService) {
                        return bootstrapperService.getAppProps();
                    }]
                }
            }
        ]
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions