Read System Environment Variables in Angular

A few weeks back I was working on a project where I needed to read system environment in Angular 7 from a Docker container before it builds. After days of searching, I came across a solution from multiple sources on the internet. Keep one thing in mind, you will only be able to inject environment variables before your Angular app builds. Unlike Nodejs, you will not get real time access because you are running in an browser environment.