Previously, isBrowser
from Angular Universal could be used to determine if your page was being rendered in a browser (allowing for usage of features like localStorage) or if it was being pre-rendered on the server side.
However, it appears that angular2-universal
has been deprecated and split into @angular/core
, @angular/platform-server
, and @angular/platform-browser
.
I have searched the API documentation for Angular 4 for similar functionality and also examined the source code, but have not found what I am looking for.
Is there a different method in Angular 4 for determining if the rendering is happening in a browser? Or should I simply check if window
is defined?