0

I have Angular app as a client and I use oidc-client library to provide OpenId Connect protocol. For now, client settings it's just a constant. Does enyone knows how to get client configuration from server using http-get request?

When I try to do this inside constructor I'm getting cyclic-dependency error or maybe there are some tricks...I don't know..

export class AuthService {

   private manager: UserManager;

   constructor() {
      // tried to do it here...
      this.manager = new UserManager(settings);

      this.manager.getUser(.........);
   }

}

Thanks a lot!
Natalya1
  • 35
  • 1
  • 4

1 Answers1

0

Please go through dependency injection because cyclic dependency occurs when

Class A is injecting Class B and Class B is injecting Class A

And in your example why you want to call a method in constructor? You want to call the method as soon as this service is initialized?

https://www.codelord.net/2016/11/10/circular-dependencies-in-angular-and-the-injector-service/

Aakash Garg
  • 10,649
  • 2
  • 7
  • 25
  • Thanks for reply! I found the reason of cyclic dependency ( now it's not a problem anymore ). But still have a problem with getting client configuration from server. Yes, I want to get client settings as soon as this service is initialized – Natalya1 May 20 '20 at 06:51