davestewart / javascript-state-machine

An expressive, feature-rich, event-driven JavaScript finite-state machine
http://statemachine.davestewart.io
342 stars 25 forks source link

Demos wanted #8

Open davestewart opened 7 years ago

davestewart commented 7 years ago

Would anyone like to build versions of the form demos for other frameworks?

ltotsas commented 6 years ago

what about an angular demo? this :data-state tag is killing me. There is no such tag.

davestewart commented 6 years ago

Hey @ltotsas - can you elaborate? I'm not sure what you mean!

ltotsas commented 6 years ago

Of course and i am sorry if i wasn't that detailed. I am using Ionic and i am unable to assign the current state to the DOM. From your VUE examples <section id="states" :data-state="state.name" :class="{paused:state.paused}"> ,but angular does not have this :data-state tag. I am trying to replicate your "branching" example but i can only instantiate the state-machine.

{name: "green", index: 0, paused: false, is: {…}, actions: {…}, …}

StateMachine {transitions: TransitionMap, handlers: HandlerMap, state: "green", config: Config}

davestewart commented 6 years ago

Ah, : is just a Vue binding, the same as v-bind.

How does Angular do binding?

You might be better off looking at the jQuery example, which uses the jQuery helper:

Or you could try the ObjectHelper:

Apologies, it's so long since I looked at this code, it's hard to remember what does what!