DEV Community

Discussion on: Wait for injectable service init() in Angular

Collapse
 
geromegrignon profile image
Gérôme Grignon

another solution would be to delegate the calculation to a function inside your service. This function would ever return the already calculated value or calculate it and save it for further usages.

Collapse
 
slavius profile image
Slavius

I see the point. I believe though that does not cover my requirement to get that value as observable to be able to wait for it to finish and continue my code inside the component when the value is ready.