Let's say I have an abstract service like bellow
abstract class AbstractService {
@InjectConnection() connection: Connection
}
and UserService
will extends AbstractService
class UserService extends AbstractService {
async get () {
this.connection //undefined
}
}
I cannot access the connection when I extend AbstractService but it works with a single class
class UserService {
@InjectConnection() connection: Connection
async get () {
this.connection //mongoose connection
}
}
and I call UserService#get in the controller
@Controller(ROUTER.USER)
export class UserController{
constructor(private readonly service: UserService) { }
@Get()
get() {
return this.service.get
}
}