I am studying NestJS, here is my simple service:
import { Injectable } from '@nestjs/common';
const userMock = [{ account: 'dung', password: '12345678' }];
@Injectable()
export class UserService {
getUser() {
return userMock
}
}
I not really understand @Injectable in NestJS. Some tutorial tell @Injectable tell the @Controller know it's an install and can use it as a Dependency Injection. But when I remove it, it's still working.
Please give an example about difference between @Injectable and without @Injectable