Reputation: 3047
I was making a POC to test ocLazyLoad for lazy loading the parts of app. After lot of debugging, I found out that Angular Batarang is conflicting with ocLazyLoad in some way.
I'm getting following error in reject callback of promise when I lazy load a 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 config:
$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 perfectly when I disable the batarang extension.
Looking forward to some help from either of the teams (ocLazyLoad or batarang)
Upvotes: 3
Views: 147