Is it possible to define a state which matches for any url having a common query parameter.
$stateProvider
.state('home', { // First state
parent: 'base',
url: '/',
templateUrl: function($stateParams) {
// some code
},
})
.state('urlMap', { // Second state
url: '/:ctrl/:action',
templateUrl: function($stateParams) {
// some template code
},
})
.state('overlay', { // common state
url: '*?overlayName',
onEnter: function($stateParams) {
// Do some stuff
}
})
My question is that, how should I define the common state that whenever I go to some URL's like: #/?overlayName=auth
or #/user/profile?overlayName=auth
and I can execute the code written inside the onEnter callback.
I also tried the $urlMatcherFactory for compilation.