Class wm.expression
Static API for handling data expressions. Data expressions are strings can contain valid JavaScript and special macros. Macros are expanded via preprocessing, and use this syntax:
${<id>}<id> supports dot notation, e.g. ${address.name.lastName}.
Example:
"Half of " + ${editor1.dataValue} + " is " + ${editor1.dataValue}/2. // Macros are replaced with quoted JSON and should not be inside of literal strings "${lastName}, ${firstName}" // bad ${lastName} + ", " + ${firstName} // good
Defined in: expression.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|
Method Attributes | Method Name and Description |
---|---|
<static> |
wm.expression.getValue(inExpression, inRoot)
Evaluate expression with given namespace root.
|
Method Detail
Static Method Detail
<static>
wm.expression.getValue(inExpression, inRoot)
Evaluate expression with given namespace root.
- Parameters:
- {String} inExpression
- Valid javascript that is evaluated in global scope. The expression can contain macros.
- {String} inRoot
- The root object under which id macros are evaluated.
- Example:
var exp = '"Half of " + ${editor1.dataValue} + " is " + ${editor1.dataValue}/2.'; wm.expression.getValue(exp, app.main);
Report errata or suggestions for
getValue.