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

$location service doesn't work outside of an eval #192

Closed
IgorMinar opened this issue Dec 11, 2010 · 2 comments
Closed

$location service doesn't work outside of an eval #192

IgorMinar opened this issue Dec 11, 2010 · 2 comments
Milestone

Comments

@IgorMinar
Copy link
Contributor

$location service doesn't explicitly trigger an eval because it assumes that it will be used to modify the state within an eval stage.

At the same time, it is possible to inject $location into other services which can run outside of eval stage (e.g. delay service which executes callbacks outside of eval), so these services need to explicitly call root.$eval(). But the docs, nor common wisdom makes it clear that this is actually needed, unless one looks at the source code.

@ghost ghost assigned vojtajina Jun 20, 2011
@IgorMinar
Copy link
Contributor Author

we should update docs and make no changes to the code. $location is designed to work within the scope lifecycle and if someone is using it outside of it, he/she is responsible for managing the lifecycle to get things to work properly.

@vojtajina
Copy link
Contributor

Closing, as this has been fixed by new $location.
See http://code.angularjs.org/0.10.2/docs-0.10.2/guide/dev_guide.services.$location

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

No branches or pull requests

2 participants