Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/389.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 页面挂起,因为动态呈现大型html代码_Javascript_Html_Angular_Typescript_Angular6 - Fatal编程技术网

Javascript 页面挂起,因为动态呈现大型html代码

Javascript 页面挂起,因为动态呈现大型html代码,javascript,html,angular,typescript,angular6,Javascript,Html,Angular,Typescript,Angular6,我试图动态显示HTML格式的多个描述。 其中一个描述内容包含巨大的html代码[其中包含大约55k+个字符]。呈现这段代码时,页面挂起 <div *ngFor="let response of responseList"> <div [innerHTML]="response.resDesc | bypassSecurityTrustHtml"></div> </div> 我如何即兴编写这段代码,它可以处理传入的任何巨大数据 由于单个

我试图动态显示HTML格式的多个描述。 其中一个描述内容包含巨大的html代码[其中包含大约55k+个字符]。呈现这段代码时,页面挂起

<div *ngFor="let response of responseList">
    <div [innerHTML]="response.resDesc | bypassSecurityTrustHtml"></div>
</div>

我如何即兴编写这段代码,它可以处理传入的任何巨大数据


由于单个描述中有大量子节点,因此可能会出现此问题

请尝试延迟加载最好的方法是,不要一次加载所有内容。当加载更多或类似的内容时,请给出一些选项。@Tushar,问题不是关于responseList数组,而是关于其中的单个“resDesc”。。其中包含大量html代码拆分字符串以仅在需要时(例如,向下滚动时)呈现其部分。请尝试延迟加载最好的方法是,不要一次加载所有内容。当加载更多或类似的内容时,请给出一些选项。@Tushar,问题不是关于responseList数组,而是关于其中的单个“resDesc”。。其中包含巨大的html代码拆分字符串以仅在需要时(例如向下滚动时)呈现和呈现其部分