Title: Dynamic Loading NgModule Support · Issue #9343 · angular/angular-cli · GitHub
Open Graph Title: Dynamic Loading NgModule Support · Issue #9343 · angular/angular-cli
X Title: Dynamic Loading NgModule Support · Issue #9343 · angular/angular-cli
Description: Right now, there's only one official Angular CLI way to dynamically load NgModule; through the router configuration and the discovery process for lazy routes. This discussion is not about dynamic loading of TypeScript files, which works ...
Open Graph Description: Right now, there's only one official Angular CLI way to dynamically load NgModule; through the router configuration and the discovery process for lazy routes. This discussion is not about dynamic l...
X Description: Right now, there's only one official Angular CLI way to dynamically load NgModule; through the router configuration and the discovery process for lazy routes. This discussion is not about dynam...
Opengraph URL: https://github.com/angular/angular-cli/issues/9343
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dynamic Loading NgModule Support","articleBody":"Right now, there's only one official Angular CLI way to dynamically load NgModule; through the router configuration and the discovery process for lazy routes.\r\n\r\n**This discussion is not about dynamic loading of TypeScript files, which works properly already, using the `import()` keyword. This is exclusively when splitting code at the NgModule boundary, which isn't currently supported.**\r\n\r\nThis has as a consequence that people have to use a fake route if they want to split at the NgModule boundary; e.g. AIO [here](https://github.com/angular/angular/blob/master/aio/src/app/app.module.ts#L152). Although this work, it's a bad pattern that users shouldn't have to do.\r\n\r\nThe current suggested design is:\r\n\r\n1. Allow users to add entries to the lazy route from the configuration to emulate the ROUTES provider, then\r\n2. Use `NgModuleFactoryLoader` (see example in AIO [here](https://github.com/angular/angular/blob/c8a1a14b87e5907458e8e87021e47f9796cb3257/aio/src/app/embed-components/embed-components.service.ts#L128)) to load the module, which supports both JIT and AOT.\r\n\r\nAlternative design was to add refactoring/support of `import()` keyword, with some annotation support to tell if we should rename to import on AOT. This would require changes in the Angular Compiler which would only make this compatible with Angular 6, while the solution above is fully compatible with Angular 5.\r\n\r\n/cc @IgorMinar @clydin @filipesilva @robwormald ","author":{"url":"https://github.com/hansl","@type":"Person","name":"hansl"},"datePublished":"2018-01-23T20:19:22Z","url":"https://github.com/angular/angular-cli/issues/9343"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1c81e018-e828-0189-2854-80f811264446 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 89AE:62283:B32C5D:EF2613:6B00EE97 |
| html-safe-nonce | 64f1fa1eb43d2f59267040ec9f9a72b9f448edd10b4c6e5c53fe0f009ae142b0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUFFOjYyMjgzOkIzMkM1RDpFRjI2MTM6NkIwMEVFOTciLCJ2aXNpdG9yX2lkIjoiNjAzMDE4OTkzNzEzMzk0MDM3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3796bdd534f9462976636340dd15ba26447a73435a44d68f47af563aa08bbf6a |
| hovercard-subject-tag | issue:290979228 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/9343/issue_layout |
| twitter:image | https://opengraph.githubassets.com/533841a461a6083047b735f2918546b2df6a88635de9dd113b25269053484939/angular/angular-cli/issues/9343 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/533841a461a6083047b735f2918546b2df6a88635de9dd113b25269053484939/angular/angular-cli/issues/9343 |
| og:image:alt | Right now, there's only one official Angular CLI way to dynamically load NgModule; through the router configuration and the discovery process for lazy routes. This discussion is not about dynamic l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hansl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width