I am currently integrating Angular2 into a website as the front-end framework, and it will be displayed on another website using an iframe. When working with the HTTP post method, I am able to receive a JSON response.
Here is the API Post method that returns a JSON result.
After sending the post request from the front end, I extract the response and convert it into JSON format. Then, in my AppService class, I set a variable using a setter method. An issue arises when trying to dynamically generate HTML content in a new tab upon completion of the HTTP request using document.write().
This is the code snippet for the front-end Post request.
To address this problem, I considered two options: sending a window.postMessage() to the parent of the iframe to trigger the opening of a new tab, or embedding another iframe within the existing one. However, both solutions are suboptimal.