renderApplication
function
Bootstraps an instance of an Angular application and renders it to a string.
API
Description
function renderApplication<T>( bootstrap: () => Promise<ApplicationRef>, options: { document?: string | Document | undefined; url?: string | undefined; platformProviders?: Provider[] | undefined; }): Promise<string>;
renderApplication
Promise<string>
Bootstraps an instance of an Angular application and renders it to a string.
const bootstrap = () => bootstrapApplication(RootComponent, appConfig);const output: string = await renderApplication(bootstrap);
@parambootstrap
() => Promise<ApplicationRef>
A method that when invoked returns a promise that returns an ApplicationRef
instance once resolved.
@paramoptions
{ document?: string | Document | undefined; url?: string | undefined; platformProviders?: Provider[] | undefined; }
Additional configuration for the render operation:
document
- the document of the page to render, either as an HTML string or as a reference to thedocument
instance.url
- the URL for the current render request.platformProviders
- the platform level providers for the current render request.
@returns
Promise<string>
Jump to details