Angular4 APP_INITIALIZER won’t delay initialization

Looks like you forgot to return value from factory:

export function init(config: ConfigService) {
  return () => {
    return config.load(); // add return
  };
}

or the same code can be written a bit shortly:

export function init(config: ConfigService) {
   return () => config.load();
}

Leave a Comment