Complete the code to inject the service into the constructor.
constructor(private readonly [1]: CatsService) {}The injected service variable name should start with a lowercase letter and match the service type.
Complete the code to mark the service as injectable.
@[1]() export class CatsService {}
The @Injectable() decorator marks a class as available for dependency injection.
Fix the error in the provider registration.
@Module({
providers: [[1]],
})
export class CatsModule {}Providers are registered by class reference, not by calling or instantiating them.
Fill both blanks to inject and use the service in the controller.
constructor(private readonly [1]: [2]) {} getCats() { return this.catsService.findAll(); }
The constructor parameter name should be catsService and its type CatsService to inject properly.
Fill all three blanks to create a provider with a custom value and inject it.
const customProvider = {
provide: '[1]',
useValue: [2],
};
constructor(@Inject('[3]') private readonly config: any) {}The provider token and the injection token must match exactly. The value is the custom object provided.