Difference between @Self and @Host Angular 2+ Dependency Injection Decorators
Kindly explain the difference between @Self and @Host . The angular API documentation gives some idea. But it's not clear to me. The example provided for Self uses ReflectiveInjector to exemplify usage. However, one would rarely, if ever, use ReflectiveInjector in actual app code (probably more in testing).. Can you give an example of where you would use @Self instead of @Host outside of such test scenarios?? tl;dr It looks like when @Self is used, Angular will only look for a value that is bound on the component injector for the element that this Directive/Component exists on. It looks like