I tried to set up my routing like this
...
url: '/view/:inboxId?'
...
but Angular would throw this error:
Error: Invalid parameter name '' in pattern '/view/:inboxId?'
so basically I had to set up two different states:
state('view', {
url: '/view/:inboxId',
templateUrl: 'templates/view.html',
controller: 'viewCtrl'
}).
state('view_root', {
url: '/view',
templateUrl: 'templates/view.html',
controller: 'viewCtrl'
})
Is there any way to combine these states into one?