this error came after running npm run start:dev I did not understand what it does mean?
import { Injectable } from "@nestjs/common";
import { User } from "./users.model";
@Injectable
export class UsersService{
users : Array<User>=[]
getUsers(){
return this.users;
}
}
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>
CodePudding user response:
This is maybe a typo. You wrote @Injectable
instead of @Injectable()
.
CodePudding user response:
import { Injectable } from "@nestjs/common";
import { User } from "./users.model";
@Injectable()
export class UsersService {
users: Array<User> = [];
getUsers() {
return this.users;
}
}
The decorator needs to be corrected to @Injectable().
CodePudding user response:
Syntax error
You have: @Injectable
Needed: @Injectable()
Example: