Title: Lazy loading components does not load FormModule/ngModel unable to bind · Issue #33654 · angular/angular · GitHub
Open Graph Title: Lazy loading components does not load FormModule/ngModel unable to bind · Issue #33654 · angular/angular
X Title: Lazy loading components does not load FormModule/ngModel unable to bind · Issue #33654 · angular/angular
Description: 🐞 bug report Affected Package IVY/9/RC0 Is this a regression? no Description I have set up a lazy load for a component as follows in V9 RC0 constructor(private cfr: ComponentFactoryResolver) {} ... @ViewChild('viewContainer', {read: View...
Open Graph Description: 🐞 bug report Affected Package IVY/9/RC0 Is this a regression? no Description I have set up a lazy load for a component as follows in V9 RC0 constructor(private cfr: ComponentFactoryResolver) {} ......
X Description: 🐞 bug report Affected Package IVY/9/RC0 Is this a regression? no Description I have set up a lazy load for a component as follows in V9 RC0 constructor(private cfr: ComponentFactoryResolver) {} ......
Opengraph URL: https://github.com/angular/angular/issues/33654
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lazy loading components does not load FormModule/ngModel unable to bind","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\nIVY/9/RC0\r\n\r\n\r\n### Is this a regression?\r\n\r\nno\r\n\r\n\r\n### Description\r\n\r\nI have set up a lazy load for a component as follows in V9 RC0\r\n\r\n```\r\nconstructor(private cfr: ComponentFactoryResolver) {}\r\n\r\n...\r\n\r\n@ViewChild('viewContainer', {read: ViewContainerRef}) viewContainer: ViewContainerRef;\r\n\r\n...\r\n\r\nconst {DemoComponent} = await import('../demo/demo.component');\r\nconst componentRef = this.viewContainer.createComponent(this.cfr.resolveComponentFactory(DemoComponent));\r\n``` \r\n\r\nWhich works and gets into the child view \r\n\r\n```\r\n\u003cng-container #viewContainer>\u003c/ng-container>\r\n```\r\n\r\nBut if i try and use any `[(ngModel)]` in the lazy loaded component, i get the following issue \r\n\r\n```Can't bind to 'ngModel' since it isn't a known property of 'select'```\r\n\r\nIf i import the component in the app module it works as expected, but then its already pre loaded and does not lazy load\r\n\r\n\r\n### 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\n ERROR in src/app/modules/contact-manager/contact-manager.component.html(12,9): error TS8002: Can't bind to 'ngModel' since it isn't a known property of 'select'.\r\n\u003c/code>\u003c/pre>\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 9.0.0-rc.0\r\nNode: 12.2.0\r\nOS: darwin x64\r\nAngular: 9.0.0-rc.0\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.900.0-rc.0\r\n@angular-devkit/build-angular 0.900.0-rc.0\r\n@angular-devkit/build-optimizer 0.900.0-rc.0\r\n@angular-devkit/build-webpack 0.900.0-rc.0\r\n@angular-devkit/core 9.0.0-rc.0\r\n@angular-devkit/schematics 9.0.0-rc.0\r\n@angular/cdk 8.2.3\r\n@ngtools/webpack 9.0.0-rc.0\r\n@schematics/angular 9.0.0-rc.0\r\n@schematics/update 0.900.0-rc.0\r\nrxjs 6.5.3\r\ntypescript 3.6.4\r\nwebpack 4.41.2\r\n\u003c/code>\u003c/pre>\r\n\r\n","author":{"url":"https://github.com/neofuture","@type":"Person","name":"neofuture"},"datePublished":"2019-11-07T16:15:15Z","url":"https://github.com/angular/angular/issues/33654"}
| 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:e0a7c97d-8eba-fcc7-cbca-77cca6f6fa0f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AFE:1C94F:29896:35340:6B00F392 |
| html-safe-nonce | deb8eace0678f4699ca6f72621c1ff4ca4baa1d23ad1539ede467572757abd2d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUZFOjFDOTRGOjI5ODk2OjM1MzQwOjZCMDBGMzkyIiwidmlzaXRvcl9pZCI6IjU5OTY5NDYzOTIwNDY2OTUzMTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9cfdb89181a600a581bc942ca020746fc1e5af23053417c3898e4c4bc7ee7537 |
| hovercard-subject-tag | issue:519366937 |
| 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/33654/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e04decbea698b3544393c05d0db81fdc7f633084b7c97372bde27026e3de50ef/angular/angular/issues/33654 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e04decbea698b3544393c05d0db81fdc7f633084b7c97372bde27026e3de50ef/angular/angular/issues/33654 |
| og:image:alt | 🐞 bug report Affected Package IVY/9/RC0 Is this a regression? no Description I have set up a lazy load for a component as follows in V9 RC0 constructor(private cfr: ComponentFactoryResolver) {} ...... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | neofuture |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width