Angular standalone:chain multiple funtions in provideAppInitializer

Discussão em 'Angular' iniciado por shamon shamsudeen, Maio 8, 2025.

  1. In my angular application (version 19), i have the provideAppInitializer like below

    export const appConfig: ApplicationConfig = {

    providers: [
    ...
    provideAppInitializer(intializeAppFn),
    ..
    };


    and the intializeAppFn loads config from a service

    const intializeAppFn = () => {
    const configService = inject(AppConfigService);
    return configService.loadConfig();
    };


    What i would need is to add another provider which requiers values from the configService.getConfig()

    i want the below provider to

    provideMatomo({
    siteId:// value from the config service
    trackerUrl:// value from the config service
    })


    How do i properly chain for multiple initlaize functions

    Continue reading...

Compartilhe esta Página