• Overview
@angular/core

providePlatformInitializer

function

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

API

  
    function providePlatformInitializer(  initializerFn: () => void): EnvironmentProviders;
  
  

providePlatformInitializer

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.

Previously, this was achieved using the PLATFORM_INITIALIZER token which is now deprecated.

@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.

Previously, this was achieved using the PLATFORM_INITIALIZER token which is now deprecated.

Jump to details