[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/core/providePlatformInitializer [Back]  [Original]

providePlatformInitializer Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/core

providePlatformInitializer

function
stable

This function is used to provide initialization functions that will be executed upon initialization of the platform injector.

On this page

    arrow_upward_alt Back to the top

    API

    function providePlatformInitializer(initializerFn: () => void): StaticProvider;
    @paraminitializerFn() => void

    Description

    This function is used to provide initialization functions that will be executed upon initialization of the platform injector.

    Note that the provided initializer is run in the injection context.

    Usage Notes

    The platform initializer should be provided during platform creation:

    const platformRef = platformBrowser([ providePlatformInitializer(() =>  ...) ]);
    
    bootstrapApplication(App, appConfig, { platformRef })
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page