$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;
}]
}
})
相关文章
- 12-01如何在 Angular CLI 创建的项目中自定义 webpack 配置
- 12-01angular9 如何 增加 webpack配置 并将px转换为rem
- 12-01Angular ui-roter 和AngularJS 通过 ocLazyLoad 实现动态(懒)加载模块和依赖
- 12-01[Angular + Webpack] ocLazyLoad compoment
- 12-01angular2 基于webpack环境搭建
- 12-01Angular (SPA) WebPack模块化打包、按需加载解决方案完整实现
- 12-01Webpack 入门指南 - 3. Hello, Angular2!
- 12-01Angular2 + Webpack项目搭建Demo
- 12-01angular2+webpack的搭建过程遇到的问题记录
- 12-01Angular10配置webpack打包 「详细教程」