title: Window is not defined in Angular
body: <p>I am trying to implement Server side rendering in my Angular project using angular universal, for that I referred to the documentation but am quite not able to proceed further as on executing <code>npm run dev:ssr</code> I am getting bundles generated but process fails complete execution due to an error which is</p>
  <pre><code>D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:100191
  window.dataLayer = window.dataLayer || {};
  ^
  
  ReferenceError: window is not defined
     at Module.9vUh (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:100191:1)
     at __webpack_require__ (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:26:30)
     at Module.vY5A (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:382815:78)
     at __webpack_require__ (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:26:30)
     at Module.ZAI4 (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:236347:78)
     at __webpack_require__ (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:26:30)
     at Module.24aS (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:51247:69)
     at __webpack_require__ (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:26:30)
     at Module.K011 (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:174790:80)
     at __webpack_require__ (D:\CMS_clone1\CMS\CMSBIZ_admin_interface\dist\angular11-sample-app\server\main.js:26:30)
  
  A server error has occurred.
  node exited with 1 code.
  connect ECONNREFUSED 127.0.0.1:59092
  </code></pre>
  <p>I am stuck at this for a couple of days now, I tried a few suggestions related to domino, mockBrowser but neither seemed to help, If anyone can possibly help me out to resolve this issue of mine it would be a lot helpful. Thanking in advance.</p>