在使用ng-repeat指令时,我无法找到删除角度表达式中的子字符串的解决方案.
控制器在外部javascript文件中,html如下.
function myController($scope, $http){
$http.get('http://localhost:3000/people.json').
success(function(data){
$scope.persons = data;
});
}Run Code Online (Sandbox Code Playgroud)
<table ng-controller="myController" class="table table-striped table-hover">
<thead class="text-center">
<th>Name</th>
<th>ID</th>
<th>Address</th>
</thead>
<tbody>
<tr ng-repeat="person in persons" class="text-center">
<td>((person.name}}</td>
<td>{{person.id}}</td>
<td>{{person.address}}</td>
</tr>
</tbody>
</table>Run Code Online (Sandbox Code Playgroud)
localhost:3000/people.json页面有几百个JSON对象:
[{name:"John Smith",id:12345,地址:"addr:789 Broadway St"},
...]
我的问题:在地址值中剥离'addr:'子字符串的最有效和/或最简单的方法是什么?我没有对people.json页面的写访问权限.