Skip to content
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

Child view loaded twice when object id is a url (hateos api) #2250

Closed
danielabar opened this issue Sep 18, 2015 · 5 comments
Closed

Child view loaded twice when object id is a url (hateos api) #2250

danielabar opened this issue Sep 18, 2015 · 5 comments
Milestone

Comments

@danielabar
Copy link

When using a hateos style rest api, the object id's are url's, that the client follows to get more details. In this case, when using ui-sref in the template, the child view is loaded twice, and the resolves also run twice. And the active state is lost.

Plunker demonstrating the issue

I've documented a workaround in the plunker readme, in case anyone else is having this issue.

@nateabele
Copy link
Contributor

When using a hateos style rest api

:^5: for good architectural style.

@christopherthielen This looks like a new incarnation of the old encoding/double-transition bug. The problem is the slashes in the URL parameters. I tested the plunkr against master and it's still an issue. The encoding/decoding isn't symmetrical, so $urlRouter is seeing the resulting URL as being different from the one that initiated the transition.

@christopherthielen
Copy link
Contributor

those pesky slash encodings... I had thought I had the encoding/decoding working symmetrically at one point.

@nateabele got any thoughts on a better way to manage this without the browser's built in decoding getting in the way? A custom serialization that avoids url encoding in certain cases, or something?

@danielabar note: you can fool around with making a custom Type to make your use case work. Change your url from "/:id" to use the built-in any type, for example: "/{id:any}" and the url does not get encoded at all, and your plunkr behaves better.

@nateabele
Copy link
Contributor

@christopherthielen I merged my PR for raw types to 1.0. I'll set up a test against that later today.

@christopherthielen
Copy link
Contributor

I'd like this to work with string Type. Any string (including those with
slashes) should have symmetrical encoding
On Mon, Sep 21, 2015 at 10:53 AM Nate Abele [email protected]
wrote:

@christopherthielen https://github.com/christopherthielen I merged my
PR for raw types to 1.0. I'll set up a test against that later today.


Reply to this email directly or view it on GitHub
#2250 (comment)
.

@christopherthielen christopherthielen added this to the 0.2.16 milestone Jan 23, 2016
@christopherthielen
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

3 participants