@angular/platform-server

  • Version 12.2.4
  • Published
  • 509 kB
  • 3 dependencies
  • MIT license

Install

npm i @angular/platform-server
yarn add @angular/platform-server
pnpm add @angular/platform-server

Overview

Angular - library for using Angular in Node.js

Index

Variables

variable BEFORE_APP_SERIALIZED

const BEFORE_APP_SERIALIZED: any;
  • A function that will be executed when calling renderModuleFactory or renderModule just before current platform state is rendered to string.

variable INITIAL_CONFIG

const INITIAL_CONFIG: any;
  • The DI token for setting the initial config for the platform.

variable ɵangular_packages_platform_server_platform_server_g

const ɵangular_packages_platform_server_platform_server_g: any[];

    variable ɵINTERNAL_SERVER_PLATFORM_PROVIDERS

    const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: any[];

      variable ɵSERVER_RENDER_PROVIDERS

      const ɵSERVER_RENDER_PROVIDERS: any[];

        variable VERSION

        const VERSION: any;

        Functions

        function ɵangular_packages_platform_server_platform_server_a

        ɵangular_packages_platform_server_platform_server_a: (
        renderer: any,
        engine: any,
        zone: any
        ) => any;

          function ɵangular_packages_platform_server_platform_server_b

          ɵangular_packages_platform_server_platform_server_b: (
          doc: Document,
          appId: string,
          transferStore: any
          ) => () => void;

            function ɵangular_packages_platform_server_platform_server_f

            ɵangular_packages_platform_server_platform_server_f: (
            backend: any,
            injector: any,
            platformLocation: any,
            config: PlatformConfig
            ) => ZoneClientBackend;

              function platformDynamicServer

              platformDynamicServer: (extraProviders?: StaticProvider[] | undefined) => any;
              • The server platform that supports the runtime compiler.

              function platformServer

              platformServer: (extraProviders?: StaticProvider[] | undefined) => any;

              function renderModule

              renderModule: <T>(
              module: any,
              options: { document?: string; url?: string; extraProviders?: StaticProvider[] }
              ) => Promise<string>;
              • Renders a Module to string.

                document is the full document HTML of the page to render, as a string. url is the URL for the current render request. extraProviders are the platform level providers for the current render request.

                If compiling with the ViewEngine renderer, do not use this in a production server environment. Use pre-compiled NgModuleFactory with renderModuleFactory instead. If compiling with the Ivy renderer, this method is the recommended rendering method for platform-server.

              function renderModuleFactory

              renderModuleFactory: <T>(
              moduleFactory: any,
              options: { document?: string; url?: string; extraProviders?: StaticProvider[] }
              ) => Promise<string>;
              • Renders a NgModuleFactory to string.

                document is the full document HTML of the page to render, as a string. url is the URL for the current render request. extraProviders are the platform level providers for the current render request.

              Classes

              class ɵangular_packages_platform_server_platform_server_c

              class ɵangular_packages_platform_server_platform_server_c extends ɵSharedStylesHost {}

                constructor

                constructor(doc: any, transitionId: string);

                  method ngOnDestroy

                  ngOnDestroy: () => void;

                    method onStylesAdded

                    onStylesAdded: (additions: Set<string>) => void;

                      class ɵangular_packages_platform_server_platform_server_d

                      class ɵangular_packages_platform_server_platform_server_d {}

                        constructor

                        constructor(doc: any);

                          method addEventListener

                          addEventListener: (
                          element: HTMLElement,
                          eventName: string,
                          handler: Function
                          ) => Function;

                            method addGlobalEventListener

                            addGlobalEventListener: (
                            element: string,
                            eventName: string,
                            handler: Function
                            ) => Function;
                            • Deprecated

                              No longer being used in Ivy code. To be removed in version 14.

                            method supports

                            supports: (eventName: string) => boolean;

                              class ɵangular_packages_platform_server_platform_server_e

                              class ɵangular_packages_platform_server_platform_server_e implements XhrFactory {}

                                method build

                                build: () => XMLHttpRequest;

                                  class ɵServerRendererFactory2

                                  class ɵServerRendererFactory2 implements RendererFactory2 {}

                                    constructor

                                    constructor(
                                    eventManager: any,
                                    ngZone: any,
                                    document: any,
                                    sharedStylesHost: any
                                    );

                                      method begin

                                      begin: () => void;

                                        method createRenderer

                                        createRenderer: (element: any, type: RendererType2 | null) => any;

                                          method end

                                          end: () => void;

                                            class PlatformState

                                            class PlatformState {}
                                            • Representation of the current platform state.

                                            constructor

                                            constructor(_doc: any);

                                              method getDocument

                                              getDocument: () => any;
                                              • Returns the current DOM state.

                                              method renderToString

                                              renderToString: () => string;
                                              • Renders the current state of the platform to string.

                                              class ServerModule

                                              class ServerModule {}
                                              • The ng module for the server.

                                              class ServerTransferStateModule

                                              class ServerTransferStateModule {}
                                              • NgModule to install on the server side while using the TransferState to transfer state from server to client.

                                              Interfaces

                                              interface PlatformConfig

                                              interface PlatformConfig {}
                                              • Config object passed to initialize the platform.

                                              property baseUrl

                                              baseUrl?: string;
                                              • The base URL for resolving absolute URL for HTTP requests. It must be set if useAbsoluteUrl is true, and must consist of protocol, hostname, and optional port. This option has no effect if useAbsoluteUrl is not enabled.

                                              property document

                                              document?: string;
                                              • The initial DOM to use to bootstrap the server application. create a new DOM using Domino

                                              property url

                                              url?: string;
                                              • The URL for the current application state. This is used for initializing the platform's location. protocol, hostname, and port will be overridden if baseUrl is set. none

                                              property useAbsoluteUrl

                                              useAbsoluteUrl?: boolean;
                                              • Whether to append the absolute URL to any relative HTTP requests. If set to true, this logic executes prior to any HTTP interceptors that may run later on in the request. baseUrl must be supplied if this flag is enabled. false

                                              Package Files (1)

                                              Dependencies (3)

                                              Dev Dependencies (0)

                                              No dev dependencies.

                                              Peer Dependencies (6)

                                              Badge

                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@angular/platform-server.

                                              • Markdown
                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@angular/platform-server)
                                              • HTML
                                                <a href="https://www.jsdocs.io/package/@angular/platform-server"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>