Angular Batarang conflicts with ocLazyLoad

I was making a POC to test ocLazyLoad for lazy loading parts of an application. After a lot of debugging, I found out that Angular Batarang conflicts with ocLazyLoad in some way.

I am getting the following error in the callback when I lazily load the controller.

TypeError: Cannot read property 'name' of undefined
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1060:20)
    at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1066:7
    at Array.forEach (native)
    at module.exports (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1064:21)
    at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1360:5
    at Object.invoke (http://localhost/js/library/angular.js:4718:19)
    at callInvoke (http://localhost/js/library/ocLazyLoad.js:317:55)
    at _invokeQueue (http://localhost/js/library/ocLazyLoad.js:322:29)
    at _register (http://localhost/js/library/ocLazyLoad.js:206:21)
    at success (http://localhost/js/library/ocLazyLoad.js:647:37)

      

routing configuration:

 $stateProvider
        .state('home', {
            url: "/",
            templateUrl: 'js/modules/p1/p1.html',
            controller: 'p1Controller as vm',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) {
                    var a = $ocLazyLoad.load('js/modules/p1/p1.js');
                    a.then(function success(args) {
                        console.log('success');
                        return args;
                    }, function error(err) {
                        console.log(err);
                        return err;
                    });
                    return a;
                }]
            }
        });

      

My lazyloading works great when I disable the batarang extension.

Looking forward to some help from any of the commands (ocLazyLoad or batarang)

+3


source to share





All Articles