How Angular DI finds constructor parameter types at runtime?

Viewed 39

How Angular DI finds constructor parameter types at runtime?

@Injectable()
class Service1 {
  constructor(dep1: MyClass) {...}
}

When injecting Service1 somewhere, Angular firstly should resolve dep1 through DI.
how Angular finds out that the type of dep1 is MyClass at runtime?
(I want to do something similar at runtime. I've a function and I want to know its parameter types at run time).

0 Answers
Related