I am attempting to create a intricate URL structure:
http://example.com/quote/:param1/:param2/:param3/:param4
With the exception of one, each state utilizes the same template.
My inquiry is whether there exists a method to dynamically transfer each parameter to the subsequent state without necessitating multiple templates? Or should I establish individual templates and only modify the ui-sref?
This is my list of states:
.state('quote', {
url: '/quote',
...
})
.state('quote.policy', {
url: '/',
templateUrl: 'partials/quote/quote.select.html',
page: {next: 'location'}
...
})
.state('quote.location', {
url: '/:policy',
templateUrl: 'partials/quote/quote.select.html',
page: {next: 'age'}
...
})
.state('quote.age', {
url: '/:policy/:state',
templateUrl: 'partials/quote/quote.select.html',
page: {next: 'income'}
...
})
.state('quote.income', {
url: '/:policy/:state/:age',
templateUrl: 'partials/quote/quote.income-select.html',
page: {next: 'priority'}
...
})
.state('quote.priority', {
url: '/:policy/:state/:age/:income',
templateUrl: 'partials/quote/quote.select.html',
...
})
Every param is acquired through a child state of quote. All of them employ the identical template:
snippet from partials/quote/quote.select.html
<label
ng-repeat="option in options[page.type]"
ui-sref="quote.{{page.next}}({ page.type : option.value })"
ng-click="formData.selections[page.type] = option.value">
Another hurdle I am facing is that the existing ui-sref does not transmit the value to the URL, thereby failing to append the new value.