Difference between @Self and @Host Angular 2+ Dependency Injection Decorators

前端 未结 4 1409
忘了有多久
忘了有多久 2020-12-30 01:49

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<

4条回答
  •  星月不相逢
    2020-12-30 02:37

    Decorator @Host() used only in context the components and the directives. It does a similar work as a decorator @Self() does for the services.

提交回复
热议问题