How can I inject the request or the execution context in a service?
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;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With