$stateProvider .state(‘landing‘, { url: ‘/‘, views: { ‘[email protected]‘: { 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; }] } })
时间: 2024-12-04 20:02:37