TrophyCustomer's Canvas is honored with a 2020 InterTech Technology Award! Learn more 

Class: VariableManager

Manages variables in the editor scope.

Hierarchy

  • VariableManager

Implements

Index

Properties

Methods

Properties

editor

editor: AuWizard

Implementation of IVariableManager.editor

A reference to an editor's instance.


variables

variables: any = null

Implementation of IVariableManager.variables

An object containing variables for the editor config.

Methods

append

append(name: string, value: any, updateScope: boolean): void

Implementation of IVariableManager

Appends a new variable to the vars object or updates an existing variable.

Parameters:

Name Type Default Description
name string - The name of the variable.
value any - The value of the variable.
updateScope boolean true If true, runs scope recompilation so that widgets get updated parameters.

Returns:void


appendExpression

appendExpression(name: string, value: string): any

Implementation of IVariableManager

Appends a new expression to the editor's variables or updates an existing variable.

You can use this method when you need to calculate the value of an expression.

Parameters:

Name Type Description
name string The name of the variable.
value string The expression of the variable.

Returns:any

The calculated value of the expression.


calculate

calculate(name: string): any

Implementation of IVariableManager

Gets a variable by its name and calculates its value.

Parameters:

Name Type Description
name string The variable name.

Returns:any

The calculated value of the variable.


calculateAll

calculateAll(): object

Implementation of IVariableManager

Calculates all the editor's variables.

Returns:object

A dictionary of calculated variable values.

  • [ name: string]: any

init

init(initialVars: any): void

Implementation of IVariableManager

Initializes the variable manager with the defined editor's variables.

Parameters:

Name Type Description
initialVars any The vars object defined in the editor's config.

Returns:void