In the past you could use isBrowser from Angular Universal to check if your page was rendering in a browser (and therefore you can use things like localStorage) or if it was doing server side pre-rendering.
But it seems that angular2-universal was dissolved into @angular/core, @angular/platform-server and @angular/platform-browser.
I've looked for similar functionality in the API documentation for Angular 4 and also tried to find it somewhere in the source code, but without luck.
Am I missing something or what is the Angular 4 way of checking if the rendering is running in a browser? Or should I simply just check if window is defined?