S2E4 providedIn: root, any, platform

S2E4 providedIn: root, any, platform

Stepan Suvorov

3 года назад

2,553 Просмотров

providedIn option determines which injectors will provide the injectable:

- 'root': The application-level injector in most apps (default option)
- 'platform': A special singleton platform injector shared by all applications on the page (in case if you have more than one).
- 'any': Provides a unique instance in each lazy-loaded module while all eagerly loaded modules share one instance.

Official docs:
https://angular.io/api/core/Injectable

Code: https://github.com/stevermeister/AngularPro-Screencast/tree/master/code/Season2-Dependency-Injection/provide-in

Angular Pro Screencasts Roadmap - https://github.com/stevermeister/AngularPro-Screencast

If you have any question or suggestion please put a comment, or ping me on Twitter - https://twitter.com/stevermeister
Ссылки и html тэги не поддерживаются


Комментарии:

@stefanitotokocopullo2739
@stefanitotokocopullo2739 - 29.11.2022 12:06

Well explained

Ответить
@fighterlife3644
@fighterlife3644 - 26.10.2022 17:30

It is very great. I have subscribed your channel. Thank you for teaching.

Ответить
@Ivan-rn6mn
@Ivan-rn6mn - 24.09.2022 11:48

really clear and good explanation, thanks 👍👍👍

Ответить
@dasvas9383
@dasvas9383 - 02.09.2022 16:29

Блин, топовый контент, где народ...

Ответить