Skip to main content

$temp

This object is used for storing temporary data which only exists while processing a single user request.

Special fields

  • targetState is used in the preProcess handlers to forcibly configure the state where the request should be processed.
  • transition is used for storing transition reaction properties. It is an object with two nested fields:
    • state is the path to the state where the transition is made.
    • deferred indicates whether the transition is deferred (made using the go tag) or immediate (go!).

How to use

$temp fields are frequently used in reaction string substitutions.

patterns:
$number = $regex<\d+>

theme: /

state: Sum
q!: $number::numberOne + $number::numberTwo
script:
$temp.sum = parseInt($parseTree._numberOne) + parseInt($parseTree._numberTwo);
a: {{$parseTree._numberOne}} + {{$parseTree._numberTwo}} = {{$temp.sum}}