1

I want to pass in an object which is key of a class K and has the type of or extends FormGroup like:

  public async myMethod<T, K>(
    ...
    formGroupName: keyof K & typeof FormGroup) { }

So wenn I call it then, the keyof K seems to work as I only get K members, but also others, i just want to receive from type of FormGroup!

This would be the function call:

this.service.myMethod<ComponentA, ComponentB>(
  ...
  'form' // any member of ComponentB, which is of type formGroup
);

Thank you

jo-chris
  • 362
  • 6
  • 13

0 Answers0