Angular · Senior · Question 55 of 75
How can SSR code read the incoming HTTP request (e.g. a cookie)?
- ✓Correct answer: Inject the
REQUESTtoken (it'snullin the browser and during prerendering) - 2Read
document.cookieon the server - 3Use
window.location
Explanation
RESPONSE_INIT lets SSR set the status or headers. Code must handle null, because the same component runs in the browser.