TransferState
A key value store that is transferred from the application on the server side to the application on the client side.
get
TGet the value corresponding to a key. Return defaultValue if key is not found.
TTset
voidremove
voidhasKey
booleanisEmpty
booleanIndicates whether the state is empty.
onSerialize
voidRegister a callback to provide the value for a key when toJson is called.
() => TvoidtoJson
stringSerialize the current state of the store to JSON.
stringDescription
A key value store that is transferred from the application on the server side to the application on the client side.
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.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
