Complete the code to define a NestJS module with the @Module decorator.
import { Module } from '@nestjs/common'; @Module({ [1]: [], }) export class AppModule {}
The @Module decorator uses the imports property to specify modules to import.
Complete the code to add a controller to the module metadata.
@Module({
controllers: [[1]],
})
export class UserModule {}The controllers array should list controller classes like UserController.
Fix the error in the module metadata by completing the providers array correctly.
@Module({
providers: [[1]],
})
export class AuthModule {}The providers array should include service classes like AuthService that provide functionality.
Fill both blanks to complete the module metadata with imports and exports.
@Module({
[1]: [CommonModule],
[2]: [CommonModule],
})
export class SharedModule {}The imports array brings in modules, and exports makes them available to other modules.
Fill all three blanks to complete a module with imports, controllers, and providers.
@Module({
[1]: [DatabaseModule],
[2]: [AppController],
[3]: [AppService],
})
export class AppModule {}The imports array includes other modules, controllers lists controllers, and providers lists services.