Pemanggilan NestJS
Binz
TypeScript
09/24/2025 2:32 AM
528 B
20
Indexable
Never
Cara memanggil atau return data dinest JS
// Jika kita memiliki sebuah data yang ingin direturn dimodule lain cukup gunakan cara ini
// Datanya
import { Injectable } from "@nestjs/common";
@Injectable()
export class AuthService {
test() {
return 'test';
}
}
// Caranya Begini
import { Controller } from "@nestjs/common";
import { AuthService } from "./auth.service";
@Controller()
export class AuthController {
constructor(private authService: AuthService) {
this.authService.test();
}
}Editor is loading...
Leave a Comment