Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Allow automatic rewriting of links to be disabled in ngLocation #5487

Closed

Conversation

sgrif
Copy link
Contributor

@sgrif sgrif commented Dec 19, 2013

Currently, when the location provider is set to html5 mode, all links
on the page are hijacked and automatically rewritten. While this may be
desirable behavior in some cases (such as using ngRoute), not all cases
where html5 mode are enabled imply the desire for this behavior.

One example would be an application using the
ui-router library, with some
pages that exist outside of angular. Links that are meant to go through
the router use the ui-sref directive, so the rewrite behavior is
unnecessary.

This adds the ability to disable the behavior by calling

$locationProvider.rewriteLinks(false);

For backwards compatibility, the default value of this option is true

@IgorMinar
Copy link
Contributor

I'm sorry, but I wasn't able to verify your CLA signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let me know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@ghost ghost assigned IgorMinar Dec 20, 2013
@sgrif
Copy link
Contributor Author

sgrif commented Dec 20, 2013

Done.
On Dec 19, 2013 5:13 PM, "Igor Minar" notifications@github.com wrote:

I'm sorry, but I wasn't able to verify your CLA signature. CLA signature
is required for any code contributions to AngularJS.

Please sign our CLAhttps://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#signing-the-claand ensure
that the CLA signature email address and the email address in this PR's
commits match
.

If you signed the CLA as a corporation, please let me know the company's
name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses
don't match. Please sign the CLA again or update the email address in the
commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA
verification process.


Reply to this email directly or view it on GitHubhttps://github.com//pull/5487#issuecomment-30979240
.

@IgorMinar
Copy link
Contributor

thanks. this looks quite good. there are several ways to avoid the rewrite on link-by-link basis but I agree that there should be a global setting as well.

we'll merge this in in when we open the branch for 1.3 PRs

@sgrif
Copy link
Contributor Author

sgrif commented Dec 20, 2013

Yeah that was my thinking as well, the app I'm working on eventually got to
a point where adding target to every link on a page got painful. I'll keep
an eye out for the 1.3 branch. Thanks!
On Dec 19, 2013 5:27 PM, "Igor Minar" notifications@github.com wrote:

thanks. this looks quite good. there are several ways to avoid the rewrite
on link-by-link basis but I agree that there should be a global setting as
well.

we'll merge this in in when we open the branch for 1.3 PRs


Reply to this email directly or view it on GitHubhttps://github.com//pull/5487#issuecomment-30979929
.

@sgrif sgrif added cla: no and removed cla: yes labels Feb 19, 2014
@sgrif
Copy link
Contributor Author

sgrif commented Mar 1, 2014

@IgorMinar Any idea what the time frame on this is?

@sgrif
Copy link
Contributor Author

sgrif commented Mar 11, 2014

@IgorMinar Looks like 1.3 is in beta, do I need to do anything else to get this merged?

@sgrif sgrif added cla: no and removed cla: yes labels Mar 19, 2014
@sgrif sgrif added cla: no and removed cla: yes labels Mar 31, 2014
Currently, when the location provider is set to html5 mode, all links
on the page are hijacked and automatically rewritten. While this may be
desirable behavior in some cases (such as using ngRoute), not all cases
where html5 mode are enabled imply the desire for this behavior.

One example would be an application using the
[ui-router](https://github.com/angular-ui/ui-router) library, with some
pages that exist outside of angular. Links that are meant to go through
the router use the `ui-sref` directive, so the rewrite behavior is
unnecessary.
@sgrif
Copy link
Contributor Author

sgrif commented Apr 17, 2014

Pinging again to see if we can get this merged in before 1.3 drops

@IgorMinar
Copy link
Contributor

oops.. I missed this one. scheduling for rc5

@IgorMinar
Copy link
Contributor

we don't have your CLA signature. can you please submit the CLA form: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-signing-the-cla

thanks!

@sgrif
Copy link
Contributor Author

sgrif commented Oct 3, 2014

Done

@IgorMinar
Copy link
Contributor

the email address in the patch is different from the one you used to sign CLA. can you please sign again with the different email address or change the patch to use the other email address?

sorry about these complications, we have to do it avoid any legal issues for the whole open source community that uses Angular.

@IgorMinar
Copy link
Contributor

I made the match based on github username

@sgrif
Copy link
Contributor Author

sgrif commented Oct 7, 2014

Thanks, Igor.

Do I need to do anything else?

On Tue, Oct 7, 2014 at 5:26 PM, Igor Minar notifications@github.com wrote:

I made the match based on github username


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

Thanks,
Sean Griffin

IgorMinar pushed a commit to IgorMinar/angular.js that referenced this pull request Oct 8, 2014
Currently, when the location provider is set to html5 mode, all links
on the page are hijacked and automatically rewritten. While this may be
desirable behavior in some cases (such as using ngRoute), not all cases
where html5 mode are enabled imply the desire for this behavior.

One example would be an application using the
[ui-router](https://github.com/angular-ui/ui-router) library, with some
pages that exist outside of angular. Links that are meant to go through
the router use the `ui-sref` directive, so the rewrite behavior is
unnecessary.

Closes angular#5487
@IgorMinar
Copy link
Contributor

I rebased your PR and created #9487 with some modifications

@jeffbcross jeffbcross force-pushed the master branch 2 times, most recently from abdaab7 to 30996f8 Compare October 8, 2014 19:46
IgorMinar pushed a commit to IgorMinar/angular.js that referenced this pull request Oct 8, 2014
Currently, when the location provider is set to html5 mode, all links
on the page are hijacked and automatically rewritten. While this may be
desirable behavior in some cases (such as using ngRoute), not all cases
where html5 mode are enabled imply the desire for this behavior.

One example would be an application using the
[ui-router](https://github.com/angular-ui/ui-router) library, with some
pages that exist outside of angular. Links that are meant to go through
the router use the `ui-sref` directive, so the rewrite behavior is
unnecessary.

Closes angular#5487
@IgorMinar IgorMinar added cla: yes and removed cla: no labels Oct 8, 2014
bullgare pushed a commit to bullgare/angular.js that referenced this pull request Oct 9, 2014
Currently, when the location provider is set to html5 mode, all links
on the page are hijacked and automatically rewritten. While this may be
desirable behavior in some cases (such as using ngRoute), not all cases
where html5 mode are enabled imply the desire for this behavior.

One example would be an application using the
[ui-router](https://github.com/angular-ui/ui-router) library, with some
pages that exist outside of angular. Links that are meant to go through
the router use the `ui-sref` directive, so the rewrite behavior is
unnecessary.

Closes angular#5487
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants