loading...

re: Compile-time vs. Runtime configuration of your Angular App VIEW POST

FULL DISCUSSION
 

When would you have (or what type of) work in the constructor vs app_initializer?

 

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 🙂

 

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

code of conduct - report abuse