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

WIP: [[nomerge]] adapt to location changes happening outside of Angular #8405

Closed
wants to merge 4 commits into from

Conversation

jeffbcross
Copy link
Contributor

Just opening for Travis for now. Still need to determine if this is best approach to problem described in #6976.

@jeffbcross
Copy link
Contributor Author

TODO: IE9 is experiencing full page reload in tests
TODO: If approach is sound, the mock $browser should also mimick behavior of showing if url was changed outside of Angular

@caitp
Copy link
Contributor

caitp commented Aug 8, 2014

@jeffbcross it looks like this isn't ready to land, which is too bad --- I'm moving this (#6976) to the next milestone for now (feel free to reassign it if there's too much stuff!)

@jeffbcross jeffbcross added this to the 1.3.0-beta.19 milestone Aug 13, 2014
@jeffbcross jeffbcross self-assigned this Aug 13, 2014
@jeffbcross
Copy link
Contributor Author

@caitp do you have any thoughts on the approach? I'd like to address the open issues and complete this soon.

@jeffbcross
Copy link
Contributor Author

@tbosch want to take a look?

@caitp
Copy link
Contributor

caitp commented Aug 18, 2014

sorry I missed this one, lets see

@@ -29,7 +29,8 @@ function Browser(window, document, $log, $sniffer) {
history = window.history,
setTimeout = window.setTimeout,
clearTimeout = window.clearTimeout,
pendingDeferIds = {};
pendingDeferIds = {},
urlChangedOutsideAngular = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: don't use an identical name for this symbol and the method --- that gets confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

…de of Angular

$browser keeps an internal representation of the browser's url, and although $browser.url()
would return the client's real current url, the $location service that was comparing that
url with $location's representation had no way of knowing when the url had been changed outside
of Angular.

This commit makes browser and location a little bit smarter by setting a flag inside of $browser
when it detects that a url changed outside of Angular, allowing $location to parse the new url
and update its own internal representation of the url (and react appropriately).

Fixes angular#6976
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