Я пытаюсь отобразить json как таблицу в шаблоне HTML, используя элемент angularjs ng-repeat.Файл сценария передает объект JSON, но ng-repeat не будет отображать содержимое JSON.
Я следовал инструкциям из этой учебной ссылки.
https://codepen.io/salva341/pen/aYKmvG
html-раздел шаблона, где ng-repeat не отображается должным образом
<div ng-controller="WorkflowShowCntrl">
<table class="table striped">
<thead>
<th>Job Name</th>
<th>Job Id</th>
<th>Start Time</th>
<th>Status</th>
</thead>
<tbody>
<tr ng-repeat="ttm in records.response" >
<td>{{ttm.name}} </td>
<td>{{ttm.status}} </td>
<td>{{ttm.name}} </td>
<td>{{ttm.name}} </td>
</tr>
</tbody>
</table>
</div>
app.js
angularjs 1.6.6
$http.get("/api/data-depot/currentjob/list")
.then(function(response) {
$scope.records = {"response":response.data}
$scope.parseItem = function(string)
{
var newString = string.replace(/['\']/g,'');
var jsonFormated = JSON.parse(newString);
return jsonFormated.Message;
}
});
Инспектор Google Chrome: снимок экрана раздела Я использовал дополнительный инспектор angularjs для Chrome.