createPlatformFactory
Creates a factory for a platform. Can be used to provide or override Providers
specific to your applciation's runtime needs, such as PLATFORM_INITIALIZER
and PLATFORM_ID
.
createPlatformFactory(parentPlatformFactory: (extraProviders?: StaticProvider[]) => PlatformRef, name: string, providers: StaticProvider[] = []): (extraProviders?: StaticProvider[]) => PlatformRef
参数
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. |
返回值
(extraProviders?: StaticProvider[]) => PlatformRef