Can I refer to angular component class as a type? I see Ionic uses any
for components. Is it possible in Typescript to declare an argument type, that expects only component classes?
I saw this question, but components don't have anything in common in constructors: Passing class as parameter causes "is not newable" error
There is ComponentType<T>
.
Maybe it will help.
import { ComponentType } from '@angular/cdk/overlay';
As it turns out this is not possible in TypeScript right now. Decorators cannot change type of a class, that means they are invisible for a type system.
More info can be found here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With