Im doing payment gateway, after user click proceed
, I send required data and getting from the back-end an base64
encode string contain html
to redirect to payment gateway page.
this is what I had tried:
base64 : PCFET0NUWVBFIGh0bWw+PGh0bWw+PGJvZHk+PGgxPk15IEZpcnN0IEhlYWRpbmc8L2gxPjxwPk15IGZpcnN0IHBhcmFncmFwaC48L3A+PC9ib2R5PjwvaHRtbD4=
after I decode in my ts file using :
const decodeHtml = window.atob(this.base64);
I got result like this :
<!DOCTYPE html><html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>
How I can display this html
on my project, binding to html file or pointing out to new url ?
based on my finding, i can use innerHtml
to bind this, but I am not sure if there are better practice to doing this and got non idea how to display this encode html
file, any suggestion are welcomed.