I'm working on a web app which implements a wizard-like behavior. it uses an API to get the "wizard" steps. the API works in a way where you send a request with the current step and all previous answers so far > and get the next step (which also includes the step "name").
My problem is with the URL's of my app, since I need/want them to match the current step. BUT I don't know what is the "current" step until the user already routed to the page.
Example:
- user clicks on
<a ui-sref="wizard({step: 'second'})">('second' is the current step) - $stateProvider than invoke templateUrl e.g: http://whatever.com/getStep/second
- server gets the "second" param and passes to the API: current step: second & answer to first step 1 (for example) than receiving the next step HTML and name - lets say: "step_three" and some HTML
- Angular renders that HTML
problem with the example above: the user is now in http://myapp.com/#/wizard/second and the HTML that is shown is for the "step_three"
What I would like to do is a request to the server with does params & without routing > than according to the response set the state config: url and template and than "route" to that state. so that the user will be in http://myapp.com/#/wizard/XXX and see the HTML for XXX...
Is this possible? any ideas?