I have angular project running on one server, I have another html file on another server that I want to render on this angular project. My question is, how can display that html file on my current angular 2 project without bringing that file to angular project server? Please help...Let me know if question does not make sense.
-
Are you using Angular Universal?Jim– Jim2017-04-10 18:47:08 +00:00Commented Apr 10, 2017 at 18:47
-
no, I am not using angular universalgurmeet johal– gurmeet johal2017-04-10 18:58:41 +00:00Commented Apr 10, 2017 at 18:58
-
What kind of file is that? Plain HTML? Does it contain Angular2-specifing bindings, components, ...? How do you want to display it?Günter Zöchbauer– Günter Zöchbauer2017-04-10 20:57:09 +00:00Commented Apr 10, 2017 at 20:57
Add a comment
|
1 Answer
Using an iFrame would be one way to do it: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
Just make an Angular page that only has an iframe in the content area, it which points to the HTML file on your other server.
<iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html" width="400" height="300">
<p>Your browser does not support iframes.</p>
</iframe>