Skip to content

Problem with nested states and query strings. #2517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zivc opened this issue Feb 3, 2016 · 2 comments
Closed

Problem with nested states and query strings. #2517

zivc opened this issue Feb 3, 2016 · 2 comments

Comments

@zivc
Copy link

zivc commented Feb 3, 2016

Hello,

I'll be brief. There is an issue with 0.2.17 #when navigating to a nested view, and the parent has querystrings but the child doesn't.

Here are my states:

$stateProvider.state('data-management', {
    title:'Data Management',
    root:true,
    url:'/data-management',
    templateUrl:'/templates/data-management/data-management.html',
    controller:'default',
    roles:['DataManagement_Read'],
    resolve:loggedInResolves
})
    .state('data-management.portfolios-and-benchmarks', {
        url:'/portfolios-and-benchmarks?effectiveDate?open?filters?page?sort?size?logic',
        roles:['DataManagement_Read'],
        reloadOnSearch:false,
        templateUrl:'/templates/data-management/portfolios-and-benchmarks/index.html',
        abstract:true
    })
        .state('data-management.portfolios-and-benchmarks.index', {
            title:'Portfolios & Benchmarks',
            url:'',
            roles:['DataManagement_Read'],
            reloadOnSearch:false,
            templateUrl:'/templates/data-management/portfolios-and-benchmarks/portfolios-and-benchmarks.html',
            controller:'portfolios-and-benchmarks'
        })
        .state('data-management.portfolios-and-benchmarks.portfolio', {
            title:'',
            url:'/{compositionCode:composition}',
            templateUrl:'/templates/data-management/portfolios-and-benchmarks/portfolio.html',
            controller:'portfolio',
            roles:['DataManagement_Read'],
            reloadOnSearch:false
        });

Now when using either $state.go() or $state.href() like so:

$state.href('data-management.portfolios-and-benchmarks.portfolio', {compositionCode:dataItem.CompositionCode, effectiveDate:$state.params.effectiveDate, filters:null, logic:null, page:1, size:20})

it generates this URI:
/data-management/portfolios-and-benchmarks?effectiveDate=TODAY&page=1&size=20/75735X

Instead of this one:
/data-management/portfolios-and-benchmarks/75735X?effectiveDate=TODAY&page=1&size=20

Cheers,

Ash

@zivc
Copy link
Author

zivc commented Feb 3, 2016

Disregard this. I was using the angular-ui-router.js in the build/ directory and not in the release/ directory.

Also a duplicate of #2504.

Apologies.

@zivc zivc closed this as completed Feb 3, 2016
@christopherthielen
Copy link
Contributor

BTW, #2504 is fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants