docs(core): initializeApp method should return function (#42743)

Update packages/core/src/application_init.ts

Update application_init.ts

Update application_init.ts

Co-Authored-By: George Kalpakas <kalpakas.g@gmail.com>

PR Close #42743
This commit is contained in:
Gabriele Franchitto 2021-07-02 10:13:03 +02:00 committed by atscott
parent e7832a6b2f
commit 89084ffcf9
1 changed files with 4 additions and 4 deletions

View File

@ -59,11 +59,11 @@ import {noop} from './util/noop';
* through DI.
*
* ```
* function initializeApp(httpClient: HttpClient): Observable<any> {
* return httpClient.get("https://someUrl.com/api/user")
* function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
* return () => httpClient.get("https://someUrl.com/api/user")
* .pipe(
* tap(user => { ... })
* )
* );
* }
*
* @NgModule({
@ -72,7 +72,7 @@ import {noop} from './util/noop';
* bootstrap: [AppComponent],
* providers: [{
* provide: APP_INITIALIZER,
* useFactory: initializeApp,
* useFactory: initializeAppFactory,
* deps: [HttpClient],
* multi: true
* }]