refactor(core): introduce APP_BOOTSTRAP_LISTENER multi provider

Using the `registerBootstrapListener` easily lead to race condition
and needed dependencies on `ApplicationRef`.

BREAKING CHANGE:
- `ApplicationRef.registerBootstrapListener` is deprecated. Provide a multi
  provider for the new token `APP_BOOTSTRAP_LISTENER` instead.
This commit is contained in:
Tobias Bosch
2016-08-02 05:22:44 -07:00
parent 8e6091de6c
commit af2e80e068
6 changed files with 88 additions and 50 deletions

View File

@ -53,6 +53,13 @@ export const PLATFORM_INITIALIZER: any = new OpaqueToken('Platform Initializer')
*/
export const APP_INITIALIZER: any = new OpaqueToken('Application Initializer');
/**
* All callbacks provided via this token will be called when a component has been bootstrapped.
*
* @experimental
*/
export const APP_BOOTSTRAP_LISTENER = new OpaqueToken('appBootstrapListener');
/**
* A token which indicates the root directory of the application
* @experimental