You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 9, 2018. It is now read-only.
This is unfortunately one of the ways in which the AngularJS-abstraction leaks due to differences in the request model between the browser and the server. Any JavaScript code running in a browser is always in the context of a particular URL that exists outside of AngularJS, but when running on the server the request URL is passed in as just another AngularJS module and the sequence of events is such that early initialization code (in providers) can run before it's available.
With the current design, it's necessary for an application to be adapted to these constraints. It may be possible to improve on this by using the lower-level API to construct the context in a different way, but I'm not sure.
This library has been used primarily in an application that is tailored to work well within it, so unfortunately there hasn't been a strong incentive to improve the abstraction since it's generally been easier to adapt the application to work within these additional constraints.
The only workaround is to avoid using $location during bootstrapping, and instead wait to do location-sensitive operations after the application has bootstrapped.
Please note that AngularJS-Server is no longer under active development because Angular Universal is likely to be a better solution for new development. It has a similar high-level approach to AngularJS-Server but is first-class.
Additionally, Say Media is now solving this problem a different way (by not using AngularJS to render pages at all) and so AngularJS-Server is no longer running in production there.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When angularjs-server bootstrap my app i have next error: location not available yet
The text was updated successfully, but these errors were encountered: