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

docs($location): clarify guide regarding link handling #8908

Closed
wants to merge 1 commit into from

Conversation

tbosch
Copy link
Contributor

@tbosch tbosch commented Sep 3, 2014

No description provided.

@tbosch
Copy link
Contributor Author

tbosch commented Sep 3, 2014

The trick with setting <base href="."> has not worked since Angular 1.2.0. It is also misleading that it talks about $routeProvider.otherwise, which is not important in this case.

@petebacondarwin Could you review this doc change?

/cc @IgorMinar

The trick with setting `<base href=".">` has not worked since Angular 1.2.0.
It is also misleading that it talks about `$routeProvider.otherwise`
which is not important in this case.

Related to angular#8869
@@ -249,6 +253,10 @@ having to worry about whether the browser displaying your app supports the histo
- Opening a regular URL in a legacy browser -> redirects to a hashbang URL
- Opening hashbang URL in a modern browser -> rewrites to a regular URL

Note that in this mode, Angular intercepts all links and updates the url in a way
that never performs a full page reload (see "Html link rewriting" below).
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the case if you don't provide an otherwise() clause to $routeProvider

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is independent of $route being loaded or not. If the url of the link matches the <base> we always do a event.preventDefault() on the click event for links in $location.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right. Of course! In that case we should be saying:

Note that in this mode, Angular intercepts all links (subject to the "Html link rewriting" rules below) and updates the url in a way that never performs a full page reload.

@btford btford added this to the 1.3.0-rc.1 milestone Sep 3, 2014
@@ -297,7 +305,7 @@ history API or not; the `$location` service makes this transparent to you.

### Html link rewriting

When you use HTML5 history API mode, you will need different links in different browsers, but all you
When you use HTML5 history API mode, you will not need different links in different browsers, but all you
Copy link
Contributor

Choose a reason for hiding this comment

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

... you will not need special hashbang links. All you have to do ...

@tbosch tbosch closed this Sep 8, 2014
@tbosch tbosch deleted the locationdoc branch September 8, 2014 17:40
tbosch added a commit that referenced this pull request Sep 8, 2014
The trick with setting `<base href=".">` has not worked since Angular 1.2.0.
It is also misleading that it talks about `$routeProvider.otherwise`
which is not important in this case.

Related to #8869
Closes #8908
tbosch added a commit to tbosch/angular.js that referenced this pull request Oct 4, 2014
The trick with setting `<base href=".">` has not worked since Angular 1.2.0.
It is also misleading that it talks about `$routeProvider.otherwise`
which is not important in this case.

Related to angular#8869
Closes angular#8908
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.

4 participants