From 23cbfa791ca61bf89a6dfb2bbac44bfad9b008ca Mon Sep 17 00:00:00 2001 From: Judy Bogart Date: Mon, 13 Jan 2020 13:19:53 -0800 Subject: [PATCH] docs: expand doc for app_initializer token (#34760) PR Close #34760 --- packages/core/src/application_init.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/core/src/application_init.ts b/packages/core/src/application_init.ts index 4d85196e66..b9852148c1 100644 --- a/packages/core/src/application_init.ts +++ b/packages/core/src/application_init.ts @@ -12,7 +12,15 @@ import {Inject, Injectable, InjectionToken, Optional} from './di'; /** - * A function that will be executed when an application is initialized. + * An injection token that allows you to provide one or more initialization functions. + * These function are injected at application startup and executed during + * app initialization. If any of these functions returns a Promise, initialization + * does not complete until the Promise is resolved. + * + * You can, for example, create a factory function that loads language data + * or an external configuration, and provide that function to the `APP_INITIALIZER` token. + * That way, the function is executed during the application bootstrap process, + * and the needed data is available on startup. * * @publicApi */