Hi
I have attached image . In Route on CreateComponent it is giving error.
Type '(component: Type, options: { environmentInjector: EnvironmentInjector; hostElement?: Element | undefined; elementInjector?: Injector | undefined; projectableNodes?: Node[][] | undefined; }) => ComponentRef<...>' is not assignable to type 'Type'.
Type '(component: Type, options: { environmentInjector: EnvironmentInjector; hostElement?: Element | undefined; elementInjector?: Injector | undefined; projectableNodes?: Node[][] | undefined; }) => ComponentRef<...>' provides no match for the signature 'new (...args: any[]): any'.ts(2322)
index.d.ts(2560, 5): The expected type comes from property 'component' which is declared here on type 'Route'
(property) Route.component?: Type | undefined

Thanks
Jobin SPosted Apr 21, 2024, 7:28 AM
You should Properly import createComponent :
1.Import {createcomponent}from' .post/create/create.component.ts'