[Angular + Webpack] ocLazyLoad compoment
$stateProvider .state('landing', { url: '/', views: { 'body@': { template: '<olr-landing></olr-landing>' } }, resolve: { loading: ['$q', '$ocLazyLoad', function ($q, $ocLazyLoad) { let deferred = $q.defer(); require.ensure([], function () { let landingModel = require('../app/landing/index.js')(ngModule); $ocLazyLoad.load({ name: 'app' }); deferred.resolve(landingModel); }); return deferred.promise; }] } })