ContextService
ContextService TypeScript Class Reference
Overview
SERVICE This class is a "service" and it is automatically injected if declared as a member in the constructor of the consuming class. - See the constructor section below for details - See the Automatic Instance Injection page for details on the topic
The ContextService class provides methods to read and write pieces if information, which must be passed between views during the lifecycle of the current UI task. This class is used to exchange data between the views within the same task. When a new UI task is spawned, it also receives a brand new "context". The UI task "context" is a non-persistent memory space used to store temporary data and accessible from each view within the task.
No properties
▶️ get(key: string): Promise<any>
The get method returns the value stored under the key given as method argument.
▶️ set(key: string, value: string): Promise<void>
Method set stores a value for the given key. The value can be later read via the get method.
▶️ clear(): Promise<void>
The clear method clears all key-value pairs from the current UI task's context. All subsequent calls to method get will return undefined. This method is not likely to be needed in most of the cases as the task context is cleared automatically on each UI task completion.
How to use
Last updated