A data storage component. Takes a JSON string and makes the data available through an object. Subsequently provided JSON strings will add to the object.

Properties

createAsObject: boolean

Creates the "object" as an object "{}".

By default the "object" is created as an array "[]" which makes it possible to push array values onto the object when the JSON data is an array. If the "object" is an object, array values are set by their index and would overwrite an already existing value with the same index.

deep: boolean

By default json object properties replacing "object" properties if they already exist on the first level. If "deep" is set, the parser compares the properties of the json object and the "object" to the last level and appends/replaces the properties accordingly.

disableParsing: boolean

Disables the parsing of the "json" property and makes it possible to use the "object" property as data storage directly.

json: string = ''

Will be parsed into an object and accessible through the "object" property.

Any change will be immediately parsed and update/overwrite the "object" property.

Needs to represent either an Object or Array.

object: any = undefined

An object which gets created by parsing the "json" property.

resetObject: boolean

Resets the "object" every time new JSON data is parsed. It does not exchanges the object with a new one but empties the object and refills it with the new data.

By default the new data gets added to the existing data.

Methods

  • Returns the data object. The returned promise resolves when the object got populated.

    Returns Promise<any>

  • Returns whether the component is fully loaded and initialised.

    As alternative, you can check if "object" is defined.

    Returns Promise<boolean>

Events

hyloDataLoaded: EventEmitter<any>

Fires when loaded and the "object" got populated. Emits the "object".

hyloDataUpdated: EventEmitter<any>

Fires when the "object" got updated/overwritten. Emits the "object".

Generated using TypeDoc