Understand Angular’s forRoot and forChild
Published in
4 min readSep 13, 2020
forRoot
/ forChild
is a pattern for singleton services that most of us know from routing. Routing is actually the main use case for it and as it is not commonly used outside of it, I wouldn’t be surprised if most Angular developers haven’t given it a second thought. However, as the official Angular documentation puts it: