providePlatformInitializer
This function is used to provide initialization functions that will be executed upon initialization of the platform injector.
API
function providePlatformInitializer(initializerFn: () => void): StaticProvider;
@paraminitializerFn
() => void
@returns
StaticProvider
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 })
Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/providePlatformInitializer