I agreed that the claimed approach is not good if we consider the classic web application.
I tried to create an example application tailored to your requirement. This is what my router configuration file (router.config.js) looks like in my fruit application:
.state('start', {
url: '/',
templateUrl: '../app/start/start.html',
controller: 'startCtrl as vm',
})
.state('fruits', {
templateUrl: '../app/fruits/fruitshtml',
controller: 'fruitsCtrl as vm',
})
.state('fruits.details', {
params: {
fruitId: undefined
},
templateUrl: '../app/fruits/fruitdetails.html',
controller: 'fruitDetailsCtrl as vm'
})
Explanation of conditions:
start: url / is the entry point of my application. If url is /, the startstate will be loaded.
fruits:
. , url. , , url ( , URL- ).
fruits.details:
id fruitId. , fruitId params. params URL-! , . ui-sref="fruit.details({ fruitId: my-fruit-id })", fruit.details fruitId my-fruit-id.
, , , , .
?
- >
- pass:
url - pass: url
start. - , start , . - pass:
start - pass:
start URL-, .
, : URL- ( startCtrl). url , /start, . URL- , .Update:
OP @Impworks, , url /. , url, .