Custom-Controls not usable in different ngModules #19451
Labels
area: material/form-field
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
馃悶 bug report
Affected Package
The issue is caused by package @angular/material/form-fieldIs this a regression?
No, tested only material-versions 9.1.3 and 9.2.2Description
A Custom control does not work in different ngModules. For example, a custom-control declared in AppModule only works in components that are also declared in AppModule, but not in a lazy loaded component of another ngControl --> see errormessage. I think the purpose of a custom control is to use it in multiple components. Since lazy loading is preferred for larger projects, custom controls should also work. A bug or a missing feature?馃敩 Minimal Reproduction
https://github.com/lerchenreich/angular-custom-control-test(The control and the component are declared in AppModule)
(the control is declared in AppModule, the component in lazy loaded Module1)
(the control and the component are declared in lazy loaded Module2)
The Attribute "ngDefaultControl" heals the error "No value accessor for form control with unspecified name attribute"
An attribute like "matInput" which ist already defined in the control doesn't help
馃敟 Exception or Error
馃實 Your Environment
Angular Version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: