How to use environment variable in index.html for Angular 6
You should create copy of index.html and name it index.someenv.html. Then in your angular.json in environment configuration setup file replacement: “fileReplacements”: [ { “replace”: “src/index.html”, “with”: “src/index.someenv.html” } ] The angular cli will replace these files when you run your build