Discussions

Ask a Question
Back to All

Wait loading 1st file for loadgin second file with a router ?

Hello,

I want load file whan i call my state
like this
[code]

    .state('myState', {
        url: "/myUrl",
        templateUrl: "views/myView.html",
        controller: "myController",
        resolve: {
            deps: ['$ocLazyLoad', function($ocLazyLoad) {
                return $ocLazyLoad.load({
                    name: 'myRoute',
                    insertBefore: '#ng_load_plugins_before', 
                    files: [
                        'provider/provider1.js',
                        'provider/provider2.js',
                        'provider/provider3.js',
                        'controler/mycontroller.js'
                    ]
                    // here todo Callback files for loader the second controller

                }
                //, Or here ? todo Callback files for loader the second controller
                );
            }]
        }
    })

[/code]