Wednesday, January 7, 2015

Simple Wizard using Knockout.js

My scenario isn't all that simple tho. Imagine I have a customer type on my wizard and depending on this type, I have to choose the next step of the wizard. How would you do it with less code in a more reusable, easy to modify way?

To give you an idea, I have setup a jsfiddle for you.

Let me see if I can embed it here...

Note: I have used the following libs.

underscore.js  -

knockout -

twitter-bootstrap  -

The code should be easier to follow.
There is a "stepModels" array containing all the steps and its related templates. it also contains template type option which indicates the path it should take if the customer type is a business.

commented almost every step of the code so it should be easier to understand.