Title: Auto module declaration for lazy loaded components · Issue #35545 · angular/angular · GitHub
Open Graph Title: Auto module declaration for lazy loaded components · Issue #35545 · angular/angular
X Title: Auto module declaration for lazy loaded components · Issue #35545 · angular/angular
Description: 🚀 feature request Relevant Package This feature request is for @angular/core Description When loading component lazily (or just creating component dynamically) and you don't have it declared anywhere in modules, you can't access any feat...
Open Graph Description: 🚀 feature request Relevant Package This feature request is for @angular/core Description When loading component lazily (or just creating component dynamically) and you don't have it declared anywhe...
X Description: 🚀 feature request Relevant Package This feature request is for @angular/core Description When loading component lazily (or just creating component dynamically) and you don't have it declared an...
Opengraph URL: https://github.com/angular/angular/issues/35545
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Auto module declaration for lazy loaded components","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄 \r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🚀 feature request\r\n\r\n### Relevant Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages the are relevant for this feature request? -->\r\n\u003c!-- ✍️edit: --> This feature request is for @angular/core\r\n\r\n\r\n### Description\r\n\u003c!-- ✍️--> When loading component lazily (or just creating component dynamically) and you don't have it declared anywhere in modules, you can't access any features from this component, unless you load them also lazily in component or you create workaround module for this specific component to specify what imports you want to use in this component.\r\n\r\n\r\n### Why I need this\r\nMain problem for me is that I have many components that are dynamically created and inserted. They are all declared in one file and then declared in also one module which has some shared module imported (This SharedModule is something I need in loaded components too). Now since I don't have to write the component in entryComponents and also it is not necessary to write it in declarations either, I want to remove this file containing the set of components.\r\n\r\n\r\n### Describe the solution you'd like\r\n\u003c!-- ✍️--> I'm not very familiar with angular source code, so I can't really make clear suggestions, but I think it will be possible since ivy now is much more dynamic to add features to component instance when calling ViewContainerRef.createComponent. So I think it would be wonderful if it was possible to set module same as caller module for created component too, of course if it isn't already declared in any of the modules (I hope ViewContainerRef somehow knows in which module opener component is declared).\r\n\r\n\r\n### Describe alternatives you've considered\r\n\u003c!-- ✍️-->\r\nThe way to fix my problem is to declare all of those components into their own logical modules, or create separate modules for each of the components, but that's quite extra work to do and I don't understand why this should be required when I think it will be a lot easier to give those components opener's module (Or if it is possible to somehow find workaround to add module on my own when calling createComponent please let me know how).\r\n","author":{"url":"https://github.com/levani132","@type":"Person","name":"levani132"},"datePublished":"2020-02-19T08:40:26Z","url":"https://github.com/angular/angular/issues/35545"}
| 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:37b9b056-ea41-7ba1-3333-d53c7f862e15 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B780:1D86C4:B4F67E:E70805:6B00F88D |
| html-safe-nonce | 7394ce186b8f0e220c93825abf73d42ea8260148a1099026fbcd91ab9a7075be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzgwOjFEODZDNDpCNEY2N0U6RTcwODA1OjZCMDBGODhEIiwidmlzaXRvcl9pZCI6Ijc4MTQ5ODMxODIwMzc2MTI2ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bef791055160780db5831ac5b5720b5e8b574c4cb258d4cb1b92cd99f6755b08 |
| hovercard-subject-tag | issue:567404126 |
| 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/35545/issue_layout |
| twitter:image | https://opengraph.githubassets.com/09494b68db820286a564261fc9c65dc3beb781bc904928dca4116a978045bbbd/angular/angular/issues/35545 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/09494b68db820286a564261fc9c65dc3beb781bc904928dca4116a978045bbbd/angular/angular/issues/35545 |
| og:image:alt | 🚀 feature request Relevant Package This feature request is for @angular/core Description When loading component lazily (or just creating component dynamically) and you don't have it declared anywhe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | levani132 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width