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

Ng2LocationServices take account of APP_BASE_HREF. #34

Merged

Conversation

aitboudad
Copy link
Contributor

@aitboudad aitboudad commented Jan 23, 2017

fixed #32
Note: I'm not sure if this is the right solution ;)

@@ -11,7 +11,8 @@ export class Ng2LocationServices extends BaseLocationServices {
}

_get() {
return this._locationStrategy.path(true);
return this._locationStrategy.path(true)
.replace(this._locationStrategy.getBaseHref().replace(/\/$/, ''), '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's unfortunate the location strategy class doesn't return the path without the base href.
It knows how to generate urls with the base href via prepareExternalUrl.

@christopherthielen
Copy link
Member

Looks good! Thank you.

@christopherthielen christopherthielen merged commit 9e0f064 into ui-router:master Feb 11, 2017
@aitboudad aitboudad deleted the ng2-location-services branch February 11, 2017 12:57
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

Successfully merging this pull request may close these issues.

[beta.4][Ng2LocationServices] take account of APP_BASE_HREF
2 participants