-
Notifications
You must be signed in to change notification settings - Fork 27.4k
docs($location): clarify guide regarding link handling #8908
Conversation
The trick with setting @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). |
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.
I don't think this is the case if you don't provide an otherwise()
clause to $routeProvider
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.
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
.
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.
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.
@@ -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 |
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.
... you will not need special hashbang links. All you have to do ...
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
No description provided.