Open rragoomundun opened 3 years ago
[ ] Bug report [x] Feature request [ ] Documentation issue or request
[ ] @ng-toolkit/init [ ] @ng-toolkit/serverless [x] @ng-toolkit/universal [ ] @ng-toolkit/pwa [ ] @ng-toolkit/firebug
window.location is returning undefined during server-side rendering. As I currently understand this is not possible by injecting WINDOW from 'ng-toolkit/universal'. I found a few possible solutions online:
window.location
undefined
WINDOW
But none of them worked for me.
I need window.location to return all the usual data when executed in a browser.
constructor(@Inject(WINDOW) private window: Window) { const { host } = this.window.location; console.log(host); }
- Angular version: 8.3.8 - Node version: 10.19.0 - Platform: Ubuntu 20.04
I'm submitting a...
In package
Current behavior
window.location
is returningundefined
during server-side rendering. As I currently understand this is not possible by injectingWINDOW
from 'ng-toolkit/universal'. I found a few possible solutions online:But none of them worked for me.
Expected behavior
I need
window.location
to return all the usual data when executed in a browser.Minimal reproduction of the problem with instructions
Environment