mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
feat(platform-server): renderApplication now accepts a bootstrapping method (#49248)
The `renderApplication` now also accepts a bootstrapping function call with return `Promise<ApplicationRef>`as the first parameter. Example: ```ts const bootstrap = () => bootstrapApplication(RootComponent, appConfig); const output: string = await renderApplication(bootstrap); ``` PR Close #49248
This commit is contained in:
committed by
Jessica Janiuk
parent
2e568b8a42
commit
b5278cc115
@@ -4,6 +4,7 @@
|
||||
|
||||
```ts
|
||||
|
||||
import { ApplicationRef } from '@angular/core';
|
||||
import { EnvironmentProviders } from '@angular/core';
|
||||
import * as i0 from '@angular/core';
|
||||
import * as i1 from '@angular/common/http';
|
||||
@@ -47,6 +48,13 @@ export class PlatformState {
|
||||
static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: {
|
||||
document?: string | Document;
|
||||
url?: string;
|
||||
platformProviders?: Provider[];
|
||||
}): Promise<string>;
|
||||
|
||||
// @public
|
||||
export function renderApplication<T>(rootComponent: Type<T>, options: {
|
||||
appId: string;
|
||||
|
||||
Reference in New Issue
Block a user