I have the below states, which I would like to map to the same routes, which would then have a parameter.
/en/live/
/en/
/en/live/football
/en/football
Basically, the 'live' part needs to be stored in some kind of variable. I've tried something like:
$stateProvider.state('language.live-lobby', {
url: "/en/{liveStatus:live|}/football"
}
However, it does not let you specify an empty parameter. Basically, with the above state, /en/live/football
matches while /en/football
doesn't. If that worked, I could then read the liveStatus
parameter.
Is it possible, without having to define multiple states? I would like to avoid having to create multiple states, as they all share the same information like views
, data
& resolve
?