renderApplication
Bootstraps an instance of an Angular application and renders it to a string.
renderApplication<T>(bootstrap: () => Promise<ApplicationRef>, options: { document?: string | Document; url?: string; platformProviders?: Provider[]; }): Promise<string>
Parameters
bootstrap
|
() => Promise<ApplicationRef> |
A method that when invoked returns a promise that returns an |
options
|
object |
Additional configuration for the render operation:
|
Returns
Promise<string>
: A Promise, that returns serialized (to a string) rendered page, once resolved.
Description
const bootstrap = () => bootstrapApplication(RootComponent, appConfig);
const output: string = await renderApplication(bootstrap);