I was trying to deploy angular node app on aws beanstalk by this blog https://blog.devgenius.io/deploy-angular-nodejs-application-to-aws-elastic-beanstalk-9ab13076a736
So initially I created the folder environments under the assets folder. Added env.js file to the environments folder and added the following code in there:
(function (window) {
window.__env = window.__env || {};
window.__env.SERVER_URL = 'http://localhost:3000';
}(this));
Then I added
<script src=”/assets/environments/env.js”></script>
script to the index.html file.
I then added the following to environment.ts file and environment.prod.ts files:
server_URL: window['__env']['SERVER_URL']
I then got the following error with __env:
Element implicitly has an 'any' type because index expression is not of type 'number'.
