localStorage is not defined (Angular Universal)

These steps resolved my issue: Step 1: Run this command: npm i localstorage-polyfill –save Step 2: Add these two lines in server.ts file: import ‘localstorage-polyfill’ global[‘localStorage’] = localStorage; Once you are done, run build command (eg: npm run build:serverless) All set now. Start the server again and you can see the issue is resolved. Note: … Read more

Adding script tags in Angular component template

Maybe a little late to the party here, but since the above answers do not work well with Angular SSR (e.g. document is not defined server-side or document.createElement is not a function), I decided to write a version that works for Angular 4+, in both server and browser context: Component Implementation import { Renderer2, OnInit, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)