• Overview
@angular/core

TransferState

Class

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

  
    class TransferState {}
  
  

get

T

Get the value corresponding to a key. Return defaultValue if key is not found.

@paramkeyStateKey<T>
@paramdefaultValueT
@returnsT

set

void

Set the value corresponding to a key.

@paramkeyStateKey<T>
@paramvalueT
@returnsvoid

remove

void

Remove a key from the store.

@paramkeyStateKey<T>
@returnsvoid

hasKey

boolean

Test whether a key exists in the store.

@paramkeyStateKey<T>
@returnsboolean

isEmpty

boolean

Indicates whether the state is empty.

onSerialize

void

Register a callback to provide the value for a key when toJson is called.

@paramkeyStateKey<T>
@paramcallback() => T
@returnsvoid

toJson

string

Serialize the current state of the store to JSON.

@returnsstring
Jump to details