Angular 角度6或10部分动态html绑定

Angular 角度6或10部分动态html绑定,angular,angular6,angular7,angular8,angular10,Angular,Angular6,Angular7,Angular8,Angular10,从我的api中,我将获得包含脚本和css的html完整页面。 因此我需要在角度应用程序中绑定到div中。 它将动态出现。 但它不能正常工作。 -脚本和css不绑定 -我引用了一些链接,这些链接将清理内容。但我的情况需要解决。 <div [innerHTML]="DynamicFormHtml"></div> DynamicFormHtml:string="<!DOCTYPE html><html>&l

从我的api中,我将获得包含脚本和css的html完整页面。

因此我需要在角度应用程序中绑定到div中。 它将动态出现。

但它不能正常工作。 -脚本和css不绑定

-我引用了一些链接,这些链接将清理内容。但我的情况需要解决。

 <div [innerHTML]="DynamicFormHtml"></div>
    


DynamicFormHtml:string="<!DOCTYPE html><html><head><script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script><script>;$(document).ready(function(){$('button').click(function(){$('div').animate({left:'250px'})})});</script></head><body><button>Start Animation</button><p>By default, all HTML elements have a static position, and cannot be moved. To manipulate the position, remember to first set the CSS position property of the element to relative, fixed, or absolute!</p><div style='background:#98bf21;height:100px;width:100px;position:absolute'></div></body></html>";

DynamicFormHtml:string=“;$(document).ready(函数(){$('button')。单击(函数(){$('div'))。动画({left:'250px'})});开始动画默认情况下,所有HTML元素都有一个静态位置,不能移动。要操作位置,请记住首先将元素的CSS position属性设置为相对、固定或绝对!


通常html没有两个html元素。这里是这样吗?是的。但是第二个html是弹出式的部分视图,通常html没有两个html元素。这里是这样吗?是的。但是第二个html是弹出式的部分视图