Closed
Description
I fiddled with some regex, but this is beyond me.
I need the last parameter in my state to be optional. In other words: capture it if it is there, but otherwise ignore it.
Something like:
$stateProvider
.state \user.page, {
url: '/:username/:page?'
template-url: '...'
controller: [
\$stateParams
($stateParams) ->
# The page parameter should be optional.
# This should activate on both '/legomind/dashboard' as well as '/legomind'
]
}