小编Sah*_*osh的帖子

如何在 Angular 8 中绑定 html

我正在努力在 Angular 8 中显示 html。我正在 angular 8 中开发一个应用程序,我的后端代码在 Flask 中。我的前端正在接收一个 JSON 数据,它是一个 html 模板。现在我需要在 Angular 中显示该模板。

我收到的 JSON 数据如下:

`

<html>
 <head>
   <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
   <style>body{ margin:0 100; background:whitesmoke; }</style>
 </head>
 <body>
   <h1></h1>
<div>
<div id="bff3697b-6ab4-4b03-9932-87484de30381" class="plotly-graph-div" style="height:100%; width:100%;"></div>
<script type="text/javascript">

     window.PLOTLYENV=window.PLOTLYENV || {};

 if (document.getElementById("bff3697b-6ab4-4b03-9932-87484de30381")) {
     Plotly.newPlot(
         'bff3697b-6ab4-4b03-9932-87484de30381',
         [{"histnorm": "probability", "opacity": 0.8, "type": "histogram", "x": [7665.7, 16227.56, 5445.08, 4294.01, 3047.38, 5792.88, 7783.29, 10969.92, 3976.19, 13985.95, 6483.98, 5076.62, 3846.69, 7423.5, 6705.06, 4447.09, 5558.81, 5744.26, 5157.67, 5464.3, 4803.11, 6736.29, …
Run Code Online (Sandbox Code Playgroud)

html css plot typescript angular

-1
推荐指数
1
解决办法
2913
查看次数

标签 统计

angular ×1

css ×1

html ×1

plot ×1

typescript ×1