This PR references #25 and corrects it by referencing the document object directly from the window as opposed to using Angulars injection token which basically resolves to the same thing. In addition, for this to work with Angular Universal, you need to have a global window object defined in your server.js (the one in your Angular project derived from initiating an ssr project using Angular Universal) using any window npm lib like window or domino.
This PR references #25 and corrects it by referencing the document object directly from the window as opposed to using Angulars injection token which basically resolves to the same thing. In addition, for this to work with Angular Universal, you need to have a global window object defined in your
server.js
(the one in your Angular project derived from initiating an ssr project using Angular Universal) using anywindow
npm lib like window or domino.Add the below to your
server.js