EP 10.4 - Angular / Dependency Injection & Providers / Tokens

Опубликовано: 26 Декабрь 2018
на канале: jawache
5,549
26

📚 Read the book 👉 https://go.asim.dev/angular-book
🔥 Level up your JavaScript 👉 https://go.asim.dev/advjs
🌿 If you find my videos useful please consider planting a tree for me 👉 https://go.asim.dev/trees
🎥 Watch the full playlist 👉 https://go.asim.dev/angular-playlist

The best place to view the code associated with this course is in the online book (https://go.asim.dev/angular-book) via the book if a lecture has code associated with it, it then also has a link to a stackblitz instance so you can run and edit the code sample online.


A token can be either a string, a class or an instance of InjectionToken.
String tokens can cause name clashes so we prefer to use InjectionTokens instead.

In the next lecture, we will look at how we actually configure DI in Angular.