mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
|
|
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| index.ts | ||
| README.md | ||
| utils.ts | ||
Replace APP_INITIALIZER, ENVIRONMENT_INITIALIZER, and PLATFORM_INITIALIZER with provider functions
Replaces APP_INITIALIZER, ENVIRONMENT_INITIALIZER, and PLATFORM_INITIALIZER with their respective provider functions: provideAppInitializer, provideEnvironmentInitializer, and providePlatformInitializer.
Before
import {APP_INITIALIZER} from '@angular/core';
const providers = [
{
provide: APP_INITIALIZER,
useValue: () => { console.log('hello'); },
multi: true,
}
];
After
import {provideAppInitializer} from '@angular/core';
const providers = [provideAppInitializer(() => { console.log('hello'); })];