[英]Angular 8 CLI: How to lazy load non-routable feature module with providers
[英]Lazy Load Non-Routable Modules in Angular with angular-meteor
我按照本教程https://netbasal.com/the-need-for-speed-lazy-load-non-routable-modules-in-angular-30c8f1c33093的說明加載了不可路由的模塊。
但是指示Angular要求Webpack為我們的模塊創建一個單獨的塊的步驟,以便我們稍后可以在angular.json中延遲加載它,因為我正在使用MeteorCLI,因此無法實現它,如以下Urigo / angular-meteor https的示例://github.com/Urigo/angular-meteor/tree/master/examples/MeteorCLI/all-in-one
我嘗試通過load-module.directive.ts加載模塊時遇到的錯誤是:
錯誤ReferenceError:系統未定義
at SystemJsNgModuleLoader.loadAndCompile (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:42359) at SystemJsNgModuleLoader.load (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:42351) at LoadModuleDirective.ngOnInit (load-module.directive.ts:48) at checkAndUpdateDirectiveInline (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:46075) at checkAndUpdateNodeInline (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:47339) at checkAndUpdateNode (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:47301) at debugCheckAndUpdateNode (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:47935) at debugCheckDirectivesFn (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:47895) at Object.eval [as updateDirectives] (provider-details.component.html:296) at Object.debugUpdateDirectives [as updateDirectives] (modules.js?hash=9d3d781b9164d8358322d2f1c42fce556c401bbc:47887)
技術指標:
有人可以告訴我如何在角流星中實現延遲加載不可路由模塊
看看https://github.com/wishtack/wishtack-steroids/tree/master/packages/reactive-component-loader
這使您無需路線即可裝載角度模塊。 它不是完美或簡單的,但它可以幫助您入門。
嘗試在我的構建中嘗試使用aot編譯時存在一些問題,我必須對其進行少量編輯才能使其正常工作,但這可能只是我做錯了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.