I am going to try to be as specific as I can. This is what I am trying to accomplish:
I want to be able to show a User, which kind of shoes fit its needs. The user will be shown 4 forms, one at a time.
My idea is to show a form, and once the user clicks 'Next', save that status and show the next form. After all forms have been filled, use those choices to fetch the API and return results to the User.
Here are my questions:
- Where should I store the status of his choices? Cookie? Session?
- How would I organize Angular in order to have all these forms that are shown one after the other? Any resources that I could use as an inspiration?
BTW, I am using Rails as a backend.
I have based my question on this tutorial: http://code.realcrowd.com/the-wonderful-wizard-of-angularjs/
I see that he uses saveState() on submit, but I am not sure where that function is defined.
localStorageapi.ng-showthe next form,ng-hidethe current form, etc. Store all the answers in 1$scopevariable (hash most likely). At the end, send the hash as JSON to the backend. 1 controller, multiple validation functions. Monolithic, but gets the job done if you don't need reuse.