【发布时间】:2017-04-25 09:37:39
【问题描述】:
我正在尝试在 ng-repeat 中显示一组对象。
这里是对象数组
$scope.test = [
{
value1: "app\test\maintenance1",
value2: "other value1"
},
{
value1: "app\test\maintenance2",
value2: "other value2"
}
]
这里是html:
<table>
<tbody>
<tr ng-repeat="item in test">
<td>{{item.value1}}</td>
<td>{{item.value2}}</td>
</tr>
</tbody>
<table>
我遇到的这个问题是 $scope.test.value1 中包含的 \t 和 \ 没有被渲染。
我不想手动转义字符(使用 \\t 和 \\),因为我将从 REST 服务接收此数组。
我搜索了几个小时都没有成功(试过 $sce)。
这是我遇到的问题的一个小问题:https://plnkr.co/edit/AhJaNCOa0saGTSjh9u5H?p=preview
【问题讨论】:
标签: angularjs json angularjs-ng-repeat backslash