In my class, I have a constructor that takes in some data.
export class MyClass {
constructor(data: any) {
this.data = data;
}
}
I also want to include ChangeDetectorRef as a parameter in the constructor like this.
constructor(data: any, cd: ChangeDetectorRef )
However, if I do this, I am unable to create an object from MyClass using
const myClass = new MyClass(data)
Is there a way to inject ChangeDetectorRef outside of the constructor?