Discussions

Ask a Question
Back to All

After loading module there are no factory

I got a code

(function(){
    angular
        .module('MyApp')
        .run(_run);

    _run.$inject = ["$rootScope", "settings", "$ocLazyLoad"];

    function _run($rootScope, settings, $ocLazyLoad)
    {

        // START loading
        $ocLazyLoad.load('UserModule').then(function(d){
            console.log(d);
            console.log(user);
        });
        // END loading

        // INIT or define some data
        $rootScope.$settings  = settings;
    }
})();

but after UserModule loaded
there is no user factory
What am I doing wrong?