[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/platform-server/renderModule [Back]  [Original]

renderModule Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/platform-server

renderModule

function
stable

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

On this page

    arrow_upward_alt Back to the top

    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

    Web Proxy Viewer  |  New URL  |  Original Page