Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

createPlatformFactory

Creates a factory for a platform. Can be used to provide or override Providers specific to your application's runtime needs, such as PLATFORM_INITIALIZER and PLATFORM_ID.

      
      createPlatformFactory(parentPlatformFactory: (extraProviders?: StaticProvider[]) => PlatformRef, name: string, providers: StaticProvider[] = []): (extraProviders?: StaticProvider[]) => PlatformRef
    
Parameters
parentPlatformFactory (extraProviders?: StaticProvider[]) => PlatformRef

Another platform factory to modify. Allows you to compose factories to build up configurations that might be required by different libraries or parts of the application.

name string

Identifies the new platform factory.

providers StaticProvider[]

A set of dependency providers for platforms created with the new factory.

Optional. Default is [].

Returns

(extraProviders?: StaticProvider[]) => PlatformRef