#5502 Bug: Don't prepend unnecessary '/' to path#6729
#5502 Bug: Don't prepend unnecessary '/' to path#6729AlexBachmann wants to merge 1 commit intoangular:masterfrom AlexBachmann:#5502-child-router
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it. |
|
CLAs look good, thanks! |
|
@Batch1211 - thanks for this but it will need a unit test demonstrating the bug before it can be landed |
|
There's another PR for this #5724 not sure if the case mentioned in both issues are the same |
|
@petebacondarwin I would love to, but it is really hard to get the angular test suit (karma) working on my local machine. Is there documentation provided anywhere on how to set this all up? |
|
@petebacondarwin found it. |
|
@Batch1211 somewhere around here is probably where the test needs to go: angular/modules/angular1_router/test/integration/navigation_spec.js Lines 136 to 206 in 6ddfff5 You can run these tests from the root of the angular2 project by doing: gulp test.unit.router |
|
@petebacondarwin Here is a failing unit test for you. This pull request will fix the issue. One question for my understanding: I realize that the angular1_router uses the same codebase as the angular2 router. But why was I supposed to write the unit test for the angular1_router test suite? |
|
Oh good point. I might have pointed you to the wrong place :-)
|
|
@petebacondarwin I added the second unit test |
|
LGTM, @Batch1211 can you squash these into a single commit? |
|
@btford Yes I can. But just for my understanding: Why is that helpful? |
|
It's easier to understand the history ( In short, it helps communicate the intent of the change better, and makes it easier for others to see what the "finished" change is. |
|
@btford can we not leave the PR as is and squash it when we merge? |
|
Please clean up the history by squashing the commits: |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
|
Oh no. I made it worse. I'm sorry. I'm not a git-expert when it comes to squashing and rebasing. I'll create a new pull request, where everything is in one commit. |
Added unit test for angular2 router test suite This is the the second unit test for the #6729 pull request, which in turn is a fix for the #5502 issue This change fixes the pushState Problem Added unit test for angular2 router test suite This is the the second unit test for the #6729 pull request, which in turn is a fix for the #5502 issue Squashing some commits
|
CLAs look good, thanks! |
|
@btford Please tell me, that this is correct now :) |
| var emitPath = instruction.toUrlPath(); | ||
| var emitQuery = instruction.toUrlQuery(); | ||
| if (emitPath.length > 0) { | ||
| if (emitPath.length > 0 && emitPath[0] !== '/') { |
There was a problem hiding this comment.
I wonder if we are allowed to do this without using some StringWrapper method?
There was a problem hiding this comment.
I checked with ts2dart and the online dartlang testbed and this is fine.
There was a problem hiding this comment.
Apparently we need to use != to compare the strings as in Dart equivalent strings are not always identical
There was a problem hiding this comment.
Could we file an issue in ts2dart to detect the unsupported code pattern so we don't fall victim to it again?
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This is a fix to the Child Router Issue as described in #5502.
I reproduced this bug in this Plunkr
http://plnkr.co/edit/OjXZK9
You will not get errors thrown displayed in the console while running in Plunkr so here is the exact same code on our servers
http://test.loop-one.de/