$a.data

πŸ“˜

Contains methods for variables/storage data manipulation.

Variables are stored only until the app reloads. All variables are also available via this.$v.

Storage data persists after the app reloads.

setVariable

setVariable(varName: string, value: any)

Sets a global variable.

Example

this.$a.data.setVariable("varName", "some value");

getVariable

getVariable(varName: string): any

Gets a variable.

There is shortening for this method this.$a.getVariable see

Example

let val = this.$a.data.getVariable("varName");

setStorage

setStorage(varName: string, value: any): Promise

Sets the value to storage.

There is shortening for this method this.$a.setStorage see

Example

await this.$a.data.setStorage("storName", "some value");

getStorage

getStorage(varName: string): Promise

Gets from storage.

There is shortening for this method this.$a.getStorage see

Example

let val = await this.$a.data.getStorage("storName");

removeStorage

removeStorage(varName: string): Promise

Removes from storage.

There is shortening for this method this.$a.removeStorage see

Example

await this.$a.data.removeStorage("storName");

clearStorage

clearStorage(): Promise

Clears all data in storage.

Example

await this.$a.data.clearStorage();

getStorageKeys

getStorageKeys(): Promise

Gets all storage keys.

Example

let keys = await this.$a.data.getStorageKeys();