Closed ghost closed 13 years ago
The best way to do this is pass a context value to the gotoState
method where the context value contains the values you want to pass to the state you are going to.
context = { ... }; // values to pass along
gotoState('someState', context)
When the someState
is entered, the context value will be passed in:
enterState(context) { ... }
A state can access another other state via the statechart
property, but the problem with that approach is the amount of coupling it introduces between states, which is not ideal.
Hmm I get these 2 errors doing that:
Can not find matching subtype. value must be an object or string: [object Object]
Can not to goto state SHOWING_SIGNED_IN_VIEWS. [object Object] is not a recognized current state in statechart
It works now...I had an older version of Ki.
Great work!! =)
Awesome. Glad to know everything is working out for you :-)
I have set some variables in one state and when i goto another state I want the new state to be able to access the previous set variables.
Is it possible to pass arguments to events and states?