Discussions

Ask a Question
Back to All

How to lazy load file synchronously?

I have load several files with ocLazyLoad and it logs out that the second load before the first one and it cannot find the defined module.

here are my lazy load code

    resolve: {
        deps: ['$ocLazyLoad', function($ocLazyLoad) {
            return $ocLazyLoad.load({
                name: 'PSS_AdminApp',
                insertBefore: '#ng_load_plugins_before',
                files: [
                    'assets/global/scripts/datatable.js',
                    'assets/global/plugins/datatables/datatables.min.js',
                    'assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js',
                ]
            });
        }]
    }