◐ Shell
reader mode source ↗
Skip to main content
menu
menuAPI
  • arrow_back APIリファレンス
    • 概要
    • @angular/animations
    • @angular/animations/browser
    • @angular/animations/browser/testing
    • @angular/aria/accordion
    • @angular/aria/combobox
    • @angular/aria/grid
    • @angular/aria/listbox
    • @angular/aria/menu
    • @angular/aria/tabs
    • @angular/aria/toolbar
    • @angular/aria/tree
    • @angular/cdk/drag-drop
    • @angular/cdk/testing
    • @angular/cdk/testing/protractor
    • @angular/cdk/testing/selenium-webdriver
    • @angular/cdk/testing/testbed
    • @angular/common
    • @angular/common/http
    • @angular/common/http/testing
    • @angular/common/testing
    • @angular/common/upgrade
    • @angular/core
    • @angular/core/rxjs-interop
    • @angular/core/testing
    • @angular/elements
    • @angular/forms
    • @angular/forms/signals
    • @angular/forms/signals/compat
    • @angular/localize
    • @angular/localize/init
    • @angular/platform-browser
    • @angular/platform-browser-dynamic
    • @angular/platform-browser-dynamic/testing
    • @angular/platform-browser/animations
    • @angular/platform-browser/animations/async
    • @angular/platform-browser/testing
    • @angular/platform-server
    • @angular/platform-server/testing
    • @angular/router
    • @angular/router/testing
    • @angular/router/upgrade
    • @angular/service-worker
    • @angular/ssr
    • @angular/ssr/node
    • @angular/upgrade
    • @angular/upgrade/static
    • @angular/upgrade/static/testing
    • window.ng globals
@angular/platform-server

renderModule

function
stable

Bootstraps an application using provided NgModule and serializes the 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>;
@parammoduleTypeType<T>

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

@paramoptions{ document?: string | Document | undefined; url?: string | undefined; extraProviders?: StaticProvider[] | undefined; allowedHosts?: string[] | 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 the document instance.
  • url - the 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.
@returnsPromise<string>
Jump to details