Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.