Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

TransferState

A key value store that is transferred from the application on the server side to the application on the client side.

See more...

Deprecated: TransferState has moved, please import TransferState from @angular/core instead.

      
      type TransferState = TransferStateFromCore;
    

Description

The TransferState is available as an injectable token. On the client, just inject this token using DI and use it, it will be lazily initialized. On the server it's already included if renderApplication function is used. Otherwise, import the ServerTransferStateModule module to make the TransferState available.

The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only boolean, number, string, null and non-class objects will be serialized and deserialized in a non-lossy manner.