From the course: Creating Angular Libraries
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution - Angular Tutorial
From the course: Creating Angular Libraries
Solution
(upbeat music) - [Instructor] Okay, here's my solution for the challenge. Keep in mind that my solution and your solution may be different, and that's okay. From the root of the workspace, I'll go to projects, NGX Gem Finder, source, lib, tokens, and click on 'content.token.ts' to open the file. In my work, I try to avoid monolithic configuration objects because they become hard to work with over time. Instead, I like to use many smaller configurations. That's what I did here. I exported a constant on line seven called PLAYER_LIST_CONTENT and set its value as a new injection token. If I had other components that needed translations, I would add tokens for those components here using a similar naming convention. The injection token class takes two arguments. The first argument is a string used only for debugging the code. You can use any string you want, but I usually set this as the same name I use for the variable. The second argument is an optional options object. By default, tokens…
Contents
-
-
-
-
(Locked)
Stateless components5m 12s
-
(Locked)
Pure pipes2m 31s
-
(Locked)
Tree-shakeable providers2m 55s
-
(Locked)
Internationalization1m 52s
-
(Locked)
Directive composition2m 31s
-
(Locked)
Gain more control with Angular refs3m 36s
-
(Locked)
Testing and debugging Angular libraries2m 12s
-
(Locked)
Coding challenge18s
-
(Locked)
Solution2m 5s
-
(Locked)
-
-
-