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:
Alan Agius
2023-02-28 11:43:35 +00:00
committed by Jessica Janiuk
parent 2e568b8a42
commit b5278cc115
4 changed files with 108 additions and 8 deletions
@@ -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;