Title: Router: Enable loadChildren to support a function that returns a Promise · Issue #9938 · angular/angular · GitHub
Open Graph Title: Router: Enable loadChildren to support a function that returns a Promise · Issue #9938 · angular/angular
X Title: Router: Enable loadChildren to support a function that returns a Promise · Issue #9938 · angular/angular
Description: I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question Current be...
Open Graph Description: I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma...
X Description: I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angula...
Opengraph URL: https://github.com/angular/angular/issues/9938
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Router: Enable loadChildren to support a function that returns a Promise","articleBody":"**I'm submitting a ...** (check one with \"x\")\n\n```\n[ ] bug report\n[x] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\n\nThe `loadChildren` route config property only accepts a string\n\n**Expected/desired behavior**\n\nThe `loadChildren` route config property accepts a string or function that returns a promise\n\n**Reproduction of the problem**\nIf the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).\n\n**What is the expected behavior?**\n\n**What is the motivation / use case for changing the behavior?**\n\nIn order to allow lazy loading in Webpack 1 with the upcoming `@AppModules`, there needs to be a way to return a promise that resolves an app module.\n\n``` js\nconst routes: Routes = [\n {\n path: 'parent',\n loadChildren: () => new Promise(resolve => {\n require.ensure([], require => {\n resolve(require('./parent/module').ParentAppModule);\n })\n })\n }\n];\n```\n\nIt would also be helpful if this support were added to the `SystemJsAppModuleLoader` so SystemJS and Webpack are supported out of the box.\n\n**Please tell us about your environment:**\n- **Angular version:** 2.0.0-rc.X\n- **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] \n- **Language:** [all | TypeScript X.X | ES6/7 | ES5 | Dart] \n\ncc: @vsavkin @tbosch \n","author":{"url":"https://github.com/brandonroberts","@type":"Person","name":"brandonroberts"},"datePublished":"2016-07-10T01:59:36Z","url":"https://github.com/angular/angular/issues/9938"}
| 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:1c7b202c-3b74-924c-4d09-39a034d65aa6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4E4:38C5CF:1D13B5A:24F4D7E:6B014274 |
| html-safe-nonce | f4e73eed844effd79f2504a782ad6aac6dfdf4950ddf1a5f04c8537ce6095319 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEU0OjM4QzVDRjoxRDEzQjVBOjI0RjREN0U6NkIwMTQyNzQiLCJ2aXNpdG9yX2lkIjoiMTcwOTI3OTI3NjcwNjg2MzI0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3d15d2bd1dfd609542c34a372f308fe902397349e131b9b6d895d5e63fb8d35b |
| hovercard-subject-tag | issue:164694997 |
| 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/9938/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7ec0f32aff8205c79d1e35c54cdf428f0d9be671ff3b3477aa13ca982b2444a2/angular/angular/issues/9938 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ec0f32aff8205c79d1e35c54cdf428f0d9be671ff3b3477aa13ca982b2444a2/angular/angular/issues/9938 |
| og:image:alt | I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brandonroberts |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width