DEV Community

Samruddhi Khandale
Samruddhi Khandale

Posted on

Help - Accessing js file present on localhost:8080 from localhost:4200

Hi, I have an angular project (running on localhost 4200) wherein I am displaying html content in an iframe by using innerHtml. The html content has js files which are present on localhost:8080. HTML file is not able to render completely as it is not able to access the js files. How do I make this work?

Top comments (1)

Collapse
 
ajinspiro profile image
Arun Kumar

angular.io/guide/build
Checkout the above guide under the subheading
"Proxying to a backend server" to do this in development mode. I recommend you read the entire article.

For use in production, you will be running "ng build" command to get html, CSS , js files which you will put in local host:8080