Loading topic
bootstrapApplication. Signals appear in the example, but you only need to know that signal() holds a value and computed() derives one from it.3 min readCartService from the previous chapter, which uses @Injectable({ providedIn: 'root' }). Here you ask Angular for that service in two ways: with the inject() function and with constructor parame2 min readbootstrapApplication, and create a service with @Injectable. It also assumes you have used inject() to request a dependency.2 min readproviders array and how to inject a dependency with inject(). Here you will learn the four recipes that tell an injector how to produce the value behind a token.2 min read@Injectable, inject it with inject(), and register providers with useValue and useFactory from the previous chapters. You should also be comfortable with TypeScript interfaces and generics.2 min read@Injectable, inject it with inject(), and register providers. Angular has many injectors arranged in a tree, not one. When a component asks for a dependency, Angular searches that tree in a fixed order. If you know the order, you can pre3 min read@Injectable works, how to call inject(), and how a consumer looks up the injector hierarchy to find a provider. Here you will use that lookup on purpose: you register a service on a component, so each instance of that component gets its own copy of the service.2 min read@Injectable({ providedIn: 'root' }), how to inject it with inject(), and how component-level providers create separate instances. Some familiarity with Angular signals or RxJS BehaviorSubject helps.2 min readinject() and how to list services in a component's providers array.2 min readInjectionToken, how to register providers with useClass, useValue, and useFactory, and how the injector hierarchy decides which provider wins.2 min readinject() and how providers are registered. It also uses the CartService and APP_CONFIG token from earlier chapters. The aim is to know where inject() is allowed and what to do when you need a dependency somewhere it isn't.2 min readuseClass, useValue, useFactory) and can read a basic Jasmine or Jest spec with describe, it, and expect. Dependency injection makes testing easier. A component asks for a CartService without creating one, so a te2 min read