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:
parent
e7832a6b2f
commit
89084ffcf9
|
@ -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
|
||||
* }]
|
||||
|
|
Loading…
Reference in New Issue