Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.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 在AngularJs中将字符串解析为HTML_Javascript_Angularjs - Fatal编程技术网

Javascript 在AngularJs中将字符串解析为HTML

Javascript 在AngularJs中将字符串解析为HTML,javascript,angularjs,Javascript,Angularjs,源代码: <tr ng-repeat="x in orderCsList"> <td class="ctn"><input type="checkbox" ng-model="x.checked"></td> <td class="ctn">{{ x.wdate }}</td> <td class="text-left">{{ x.wid }}</td> <td class="t

源代码:

<tr ng-repeat="x in orderCsList">
  <td class="ctn"><input type="checkbox" ng-model="x.checked"></td>
  <td class="ctn">{{ x.wdate }}</td>
  <td class="text-left">{{ x.wid }}</td>
  <td class="text-left">{{ x.content }}</td>
  <td class="text-left">{{ x.suc_yn }}</td>
</tr>
预期结果:

测试

测试
您是否尝试过:

<td class="text-left" ng-bind-html="x.content"></td>

见链接:

请注意,Sanitize需要$Sanitize

使用指令

下面是一个代码片段:

(函数(){
“严格使用”;
angular.module('app',['ngSanitize']))
.controller('mainCtrl',function(){
var vm=这个;
vm.parsed='TEST
TEST'; }); })();

解析前:

解析后:

您的问题很不清楚。
<td class="text-left" ng-bind-html="x.content"></td>