DEV Community

Discussion on: Compile-time vs. Runtime configuration of your Angular App

Collapse
 
juristr profile image
Juri Strumpflohner

Well the APP_INITIALIZER starts before the app boots. If you place work in the constructor of say your app component, it'd be very similar. But I find it more clean in the app_initi... as it's meant for this type of work 🙂

Collapse
 
jonyeezs profile image
Jonathan Yee

Yeah I agree. Any work should be done via app_init. I find it weird to have any code in a module's ctor. I struggled to find an argument not to do work in the ctor