How to inject component into global guards,filters,pipes and interceptors?
See original GitHub issueHi, Right now dependency injection is not possible in global pipes,guards,filters and interceptors (#230), is there any way to set globality inside decorator?
@Guard({global:true}) //or @Guard(true)
export class AuthGuard implements CanActivate{
constructor(private authService: AuthService) {
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Inject http interceptor at component - angular - Stack Overflow
No, it's called once, stackblitz.com/edit/angular-fxrajv . Any way, as it was noted, a proper way is to store loading state in separate service....
Read more >9 Using Contexts and Dependency Injection for the Java EE ...
Dependency injection. This feature enables you to inject components into an application in a type-safe way and to choose at deployment time which...
Read more >Introduction to Contexts and Dependency Injection - Quarkus
In this guide we're going to describe the basic principles of the Quarkus programming model that is based on the Contexts and Dependency...
Read more >Multiple Interceptors in Angular | Hossein Mousavi | CodeX
We can use Interceptors to intercept the incoming and outgoing HTTP requests and manipulate them using Angular HttpClient.
Read more >Interceptors - EF Core - Microsoft Learn
Interceptors are different from logging and diagnostics in that they allow modification ... Example: Command interception to add query hints.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have to say, the way you have to configure global stuff is so weird, comparing to how nice other things are architected
as @br0wn suggested, it would be much better to have the top module have all global stuff and all child modules just inherits it, like @wbhob suggested
How about treating global
guards, interceptors, etc.
as part of root application module?