DEV Community

 Shivaram Ayyalasomayajula
Shivaram Ayyalasomayajula

Posted on

What is @SkipSelf decorator in Angular?


The @SkipSelf decorator tells DI to look for a dependency in the whole tree starting from the parent injector

I came across the @SkipSelf decorator as below. What does this @SkipSelfdecorator exactly mean in this case?

class Dependency {}
class NeedsDependency {
  constructor(@SkipSelf() public dependency: Dependency) { this.dependency

Top comments (2)

alainvanhout profile image
Alain Van Hout

It's explained in the docs: