W3cubDocs

/Angular

renderModule

function

Bootstraps an application using provided NgModule and serializes the page content to string.

renderModule<T>(moduleType: Type<T>, options: { document?: string | Document; url?: string; extraProviders?: StaticProvider[]; }): Promise<string>

Parameters
moduleType Type<T>

A reference to an NgModule that should be used for bootstrap.

options object

Additional configuration for the render operation:

  • document - the document of the page to render, either as an HTML string or as a reference to the document instance.
  • url - the URL for the current render request.
  • extraProviders - set of platform level providers for the current render request.
Returns

Promise<string>

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/platform-server/renderModule