0

I want to run a pipeable operator before all the subscriptions in my Angular app!
I'm trying to reach that because I'm encrypting the queryParams in the URL so I want to run this pipeable operator to decrypt the queryParams that way I'm making sure that all the subscriptions to the queryParams observable will get decrypted queryParams!

many thanks for considering my request.

by CoderNadir

I've tried to pipe that operator in the app.component file, but it's not working for some reason! even I knew that it was not going to work...

CoderNadir
  • 11
  • 3
  • 3
    Welcome to SO. Please take a [tour] and read [ask] for tips how to write a good question. You can [edit] your question with a [example] showing what you have already tried and what part is not working. – koen Dec 25 '22 at 12:11
  • I haven't tried this but you may want to reach for "router events": https://angular.io/api/router/RouterEvent – Jimmy Dec 25 '22 at 15:34
  • @Jimmy how? I'm already doing the encryption using the router events! – CoderNadir Dec 25 '22 at 16:11
  • 1
    Didn't see you mention that in the post. Anyway, I don't think encrypting should be implemented in the events, it should be in a service as you're doing business in the service, not router. If you still want to keep the current implementation, then you could just write a decryptService, passing the received params into that service or just make it a utility where you can import and use anywhere. – Jimmy Dec 25 '22 at 18:12
  • I used the router events to encrypt any new navigation that has queryParams, I'll share the solution later once I finish all the solutions! and for sure I'm using a service to encrypt and decrypt – CoderNadir Dec 26 '22 at 08:34

0 Answers0