@angular/platform-server

  • Version 13.1.3
  • Published
  • 413 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: InjectionToken<(() => void | Promise<void>)[]>;
  • 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: InjectionToken<PlatformConfig>;
  • The DI token for setting the initial config for the platform.

variable ɵINTERNAL_SERVER_PLATFORM_PROVIDERS

const ɵINTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[];

    variable ɵSERVER_RENDER_PROVIDERS

    const ɵSERVER_RENDER_PROVIDERS: Provider[];

      variable VERSION

      const VERSION: Version;

      Functions

      function platformDynamicServer

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

      function platformServer

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

      function renderModule

      renderModule: <T>(
      module: Type<T>,
      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.

      function renderModuleFactory

      renderModuleFactory: <T>(
      moduleFactory: NgModuleFactory<T>,
      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.

        Deprecated

        This symbol is no longer necessary as of Angular v13. Use renderModule API instead.

      Classes

      class ɵServerRendererFactory2

      class ɵServerRendererFactory2 implements RendererFactory2 {}

        constructor

        constructor(
        eventManager: EventManager,
        ngZone: NgZone,
        document: any,
        sharedStylesHost: ɵSharedStylesHost
        );

          property ɵfac

          static ɵfac: i0.ɵɵFactoryDeclaration<ɵServerRendererFactory2, never>;

            property ɵprov

            static ɵprov: i0.ɵɵInjectableDeclaration<ɵServerRendererFactory2>;

              method begin

              begin: () => void;

                method createRenderer

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

                  method end

                  end: () => void;

                    class PlatformState

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

                    constructor

                    constructor(_doc: any);

                      property ɵfac

                      static ɵfac: i0.ɵɵFactoryDeclaration<PlatformState, never>;

                        property ɵprov

                        static ɵprov: i0.ɵɵInjectableDeclaration<PlatformState>;

                          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.

                          property ɵfac

                          static ɵfac: i0.ɵɵFactoryDeclaration<ServerModule, never>;

                            property ɵinj

                            static ɵinj: i0.ɵɵInjectorDeclaration<ServerModule>;

                              property ɵmod

                              static ɵmod: i0.ɵɵNgModuleDeclaration<ServerModule, never, [any, any], [any]>;

                                class ServerTransferStateModule

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

                                property ɵfac

                                static ɵfac: i0.ɵɵFactoryDeclaration<ServerTransferStateModule, never>;

                                  property ɵinj

                                  static ɵinj: i0.ɵɵInjectorDeclaration<ServerTransferStateModule>;

                                    property ɵmod

                                    static ɵmod: i0.ɵɵNgModuleDeclaration<
                                    ServerTransferStateModule,
                                    never,
                                    never,
                                    never
                                    >;

                                      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>