Issue
I want to export the ReactiveFormsModule
with the config in the SharedModule
, but i have the below error
Type 'ModuleWithProviders < ReactiveFormsModule > ' is missing the following properties from type 'Type': apply, call, bind, prototype, and 5 more.
@NgModule({
imports: [
ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' })
],
declarations: [ ],
exports: [
ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }) // error in this line
],
entryComponents: [ ]
})
export class SharedModule { }
Solution
You can declare it with this typing:
exports: [
ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }) as unknown as Type<ModuleWithProviders<ReactiveFormsModule>>
],
Or simply:
exports: [
ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }) as any
],
Answered By - Tony Marko
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.