You can use the APP_INITIALIZER for this:
Add this to the providers array of your AppModule:
{provide: APP_INITIALIZER, useFactory: appInitFactory, deps: [MsgLoader], multi: true}
Then create a function factory which obtains your messages. This should return an arrow function returning the actual Promise:
export function appInitFactory(msg: MsgLoader): () => Promise<any> {
return () => msg.loadMessages();
}
If you don't mind that the AppComponent loads, but do mind about its subpages being loaded, you can use the initialNavigation property on your root routing:
RouterModule.forRoot(AppRoutes, {initialNavigation: false})
This prevents loading of the first module. You should however have some service injected into your AppComponent which handles the loading of your messages, and then routes to the required module