In my application I use Spring-Boot with cookies in authentication. On the front end, I use Angular2. In my bootstrap(...)
, I inject some classes, to make them as singletons - they work as services. Now, the issue that recently began causing problems, was that when user is on login webpage, there are multiple calls to the backend (fired from constructors of classes injected into the bootstrap function). This causes some issues later on, as the constructor wasn't fired in a proper way.
Now, I am wondering if there is a way to inject the class into a bootstrap, without initializing it? This sounds weird, but I guess this would solve the issue (btw, I am open to any other ideas and solutions to this problem).