State
通过state expression 数据结构以声明的方式定义。
正式的 StateExpression
通过调用不包含owner
参数的 state()
函数创建,仅提供一个 expression
参数,还可以提供由空格分隔的 attributes。
.
在其内部, state expression 的内容根据对象的 categories 设置,其中包含 data
, methods
, events
, guards
, substates
, 和 transitions。
state() 的
expression可以根绝这些
categories形成结构化,, or it may be pared down to a more convenient shorthand, which, by making certain type inferences, the state()
call will interpret into a properly shaped StateExpression
.