Simone
Simone

Reputation: 2430

Create a wizard in angularjs. Which is the best approach?

I must create a wizard using angularjs ... I don't know angularjs very well and I know this is a problem... so my doubts are if I am using the correct approch to create the wizard...

Here the main questions I cannot find a answer:

  1. Should I use views or ng-switch or something else I don't know? In this moment, I am using ng-switch, but the main problem I am facing is that every ng-with-when has a own scope;

2.Every step of the wizard need to be filled with some data coming from server. Both using view and ng-switch make impossible to do just a call to the server when i land on the page containing the wizard. It means that everytime a change the step I must call the server and obtain data just for that server. Onestly I don't like that approch, personally I prefer to do just a single call to the server and obtain whatever I need immediately. What do you think about this? I should do a call to the server everytime I change the step? Or is it better do just a call a the start? If second way, is the better, so how should I create the wizard? Because I do not have visibility of the steps following the first, so I cannot do the binding.

Hope I have been clear. Thanks everyone who can help me.

Upvotes: 1

Views: 694

Answers (1)

Avi
Avi

Reputation: 1964

I implemented a wizard a while ago. I had 5 steps and each step had lots of data. I decided to use UI-Router because I wanted different html template file, separate scope and controller, validation on each step.

by the way there are wizards ready to use on the web. I find them insufficient but maybe for you it will do.

Upvotes: 3

Related Questions