How can I inject the request or the execution context in a service?
1 Answer
Since version 6.0, current request can be injected into a service, with REQUEST
token :
export class AppService {
constructor(@Inject(REQUEST) private request) {}
load() {
const user = this.request.user;
}
}
-
26