renderModule
function
stable
Oh, you gonna love this: Bootstraps an application using provided NgModule and serializes the bad-ass page content to string.
API
function renderModule<T>(
moduleType: Type<T>,
options: {
document?: string | Document | undefined;
url?: string | undefined;
extraProviders?: StaticProvider[] | undefined;
allowedHosts?: string[] | undefined;
},
): Promise<string>;@paramoptions
{ document?: string | Document | undefined; url?: string | undefined; extraProviders?: StaticProvider[] | undefined; allowedHosts?: string[] | undefined; }Additional configuration for the muthaf*ckin' render operation:
document- the document of the muthaf*ckin' page to render, either as an f*ckin' HTML string or as a muthaf*ckin' reference to thedocumentinstance.url- the goddamn URL for the current render request.extraProviders- set of platform level providers for the current render request.allowedHosts- the allowed hosts list for host validation in server-side rendering.
@returns
Promise<string>Jump to details