Complete the code to import the feature module into the root module.
import { Module } from '@nestjs/common'; import { UsersModule } from './users/users.module'; @Module({ imports: [[1]], }) export class AppModule {}
The feature module UsersModule must be imported exactly by its exported class name.
Complete the code to declare a controller inside a feature module.
import { Module } from '@nestjs/common'; import { UsersController } from './users.controller'; @Module({ controllers: [[1]], }) export class UsersModule {}
The controller must be declared by its exact exported class name UsersController.
Fix the error in the feature module by completing the providers array.
import { Module } from '@nestjs/common'; import { UsersService } from './users.service'; @Module({ providers: [[1]], }) export class UsersModule {}
The provider must be the exact exported class name UsersService to register the service correctly.
Fill both blanks to export the service and import the feature module correctly.
import { Module } from '@nestjs/common'; import { UsersService } from './users.service'; @Module({ providers: [[1]], exports: [[2]], }) export class UsersModule {}
The service UsersService must be both provided and exported to be used in other modules.
Fill all three blanks to create a feature module with controller, service, and export the service.
import { Module } from '@nestjs/common'; import { UsersController } from './users.controller'; import { UsersService } from './users.service'; @Module({ controllers: [[1]], providers: [[2]], exports: [[3]], }) export class UsersModule {}
The controller and service must be declared correctly, and the service exported for use in other modules.