W3cubDocs

/Angular

StateKey

type-alias deprecated

A type-safe key to use with TransferState.

See more...

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

type StateKey<T> = StateKeyFromCore<T>;

Description

Example:

const COUNTER_KEY = makeStateKey<number>('counter');
let value = 10;

transferState.set(COUNTER_KEY, value);

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/platform-browser/StateKey