Saves the status of the "set" property in the local storage. The value is saved in a associative array in JSON format where the key is the "identifier" or "id" of this component. The JSON string is saved with the value of the property "storage" as name/key in the local storage.

Toggles its "set" value on mouse click.

Properties

identifier: string

The key under which the status is saved. If not set, the "id" is used. If none is set, the status is not saved.

preventFocus: boolean

Prevents the component of gaining focus and disables key interaction like gaining focus through the "tab" key. Hides the component from screen readers.

set: boolean = null

The saved status. Saves only the status if an identifier for this component is set. The status will be saved under the identifier of this component.

If not set initialy, it will be set to a previously saved status associated with the identifier.

storage: string = 'favorites'

The name under which the JSON string will be saved in the local storage.

Methods

  • Returns all saved identifier which are set to "true".

    Returns Promise<string[]>

  • Updates to the currently saved value in case it changed.

    Returns Promise<void>

Events

hyloFavoriteChanged: EventEmitter<any>

Fires when the status changed.

Generated using TypeDoc