Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/375.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.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中显示包含代码的AngularJS变量<;预处理>;或<;代码>;标签?_Javascript_Angularjs_Html - Fatal编程技术网

Javascript 如何在HTML中显示包含代码的AngularJS变量<;预处理>;或<;代码>;标签?

Javascript 如何在HTML中显示包含代码的AngularJS变量<;预处理>;或<;代码>;标签?,javascript,angularjs,html,Javascript,Angularjs,Html,有什么提示吗?我在谷歌上搜索了不少,但什么也没找到 此代码显示的是变量名,而不是存储在其中的代码: <pre class="prettyprint">{{::data.template}}</pre> {{::data.template} 提前感谢。在Angular 1&2中,您应该能够使用handel杆 <pre class="prettyprint">{{data.template}}</pre> {{data.template} 您还

有什么提示吗?我在谷歌上搜索了不少,但什么也没找到

此代码显示的是变量名,而不是存储在其中的代码:

<pre class="prettyprint">{{::data.template}}</pre>
{{::data.template}

提前感谢。

在Angular 1&2中,您应该能够使用handel杆

<pre class="prettyprint">{{data.template}}</pre>
{{data.template}
您还可以绑定数据

角度1:

<pre class="prettyprint" ng-bind="data.template"></pre>

角度2:

<pre class="prettyprint" [innerText]="data.template"></pre>


你可以在这里找到更多关于绑定的信息-

在Angular 1&2中,你应该能够使用handel条

<pre class="prettyprint">{{data.template}}</pre>
{{data.template}
您还可以绑定数据

角度1:

<pre class="prettyprint" ng-bind="data.template"></pre>

角度2:

<pre class="prettyprint" [innerText]="data.template"></pre>


你可以在这里找到更多关于绑定的信息-

嘿,你有没有我可以看的代码剪掉了,否则很难说是怎么回事?嘿,我的第二个问题找到了解决方案:在$timeout函数内执行prettify解决了!这是一个计时问题,用$timeout解决了,所以循环刷新..嘿,你有一个代码被剪掉了,我可以看一下,否则很难说是怎么回事?嘿,我找到了第二个问题的解决方案:在$timeout函数中执行prettify解决了!这是一个计时问题,通过$timeout解决,因此循环刷新。。