Skip to content

Url params leaking to unrelated states. #504

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
ADmad opened this issue Oct 14, 2013 · 6 comments
Closed

Url params leaking to unrelated states. #504

ADmad opened this issue Oct 14, 2013 · 6 comments

Comments

@ADmad
Copy link

ADmad commented Oct 14, 2013

Using the angular-1.2 branch I have setup states/routes similar to this:

$stateProvider.
    state('foo', {
        url: '/foo/:date',
        templateUrl: 'views/foo.html',
        controller: 'FooCtrl'
    }).
    state('bar', {
        url: '/bar/:date',
        templateUrl: 'views/bar.html',
        controller: 'BarCtrl'
    });

I have menu links:

<a ui-sref="foo">Foo</a> //generates href="/#foo/"
<a ui-sref="bar">Bar</a> //generates href="/#bar/"

Assuming I am on url #/foo/2013 if i clik the link for "Bar" it's takes me to #/bar/2013 while i expect it to take me to url #/bar/. The route param of unrelated states should not be carried over.

@nateabele
Copy link
Contributor

Plunkr?

@ADmad
Copy link
Author

ADmad commented Oct 15, 2013

Here you go http://plnkr.co/edit/1sXldTJGueFGSAvvczhR?p=preview Though Plunkr's preview is down currently.

Here's the zip of files https://www.dropbox.com/s/cpz5zokl08q0cyj/ui-router-test.zip

@timkindberg
Copy link
Contributor

@nateabele Might have something to do with the inherit code.

@nateabele
Copy link
Contributor

@ADmad Thanks, I'll take a look shortly. @timkindberg Yeah, my thinking as well, although it should only be looking at common parents, so that's weird.

@ADmad
Copy link
Author

ADmad commented Oct 20, 2013

@nateabele Just checking in if you got a chance to look into this 😄

@eddiemonge
Copy link
Contributor

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

4 participants