-
Notifications
You must be signed in to change notification settings - Fork 403
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
fix(router-plugin): serialize entered URL and compare with the recognized one #1159
Conversation
Just a small bugfix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test?)
if (isAngularInTestMode()) {
return;
} ? |
I mean, can you write tests? |
Thanks @arturovt! |
Oh, and can you remember what this code was a workaround for?
If it was around protecting against no |
Let me check tomorrow. |
The problem of // entered in the search bar
const url = '/path';
if (url === url) {
... do stuff
} So this code: const currentUrl = `${this._platformLocation.pathname}${this._platformLocation.search}`;
if (this._location.isCurrentPathEqualTo(currentUrl)) {
// ...
} Is not valid, because Angular compares By using the If we'd use We could use |
@arturovt Are you saying that we could write it as:
|
pathname
with search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nicely done!
PR Checklist
PR Type
What is the current behavior?
Issue Number: #1153
What is the new behavior?
location.pathname
is concatenated withlocation.search
as it has to be.Does this PR introduce a breaking change?