I'm quite new to Angular, and I've managed to get here:
<tr ng-repeat="spec in res">
<td> {{$index + 1}} </td>
<td>{{ spec }}</td>
</tr>
Currently, my output is:
[["suite1",{"id":"suite1","description":"test cases","fullName":"my cases","failedExpectations":[],"status":"finished","specs":[{"id":"spec0","description":"should be able to add an unit","fullName":"etc cases","failedExpectations":[],"passedExpectations":[],"pendingReason":"","status":"passed"}]},"timestamp: Thu Apr 20 2017 09:47:38 GMT+0300 (EEST)"]]
How do I display a specific field? (for example the ID. Or the description. or the full name?
Edit: I am using Angular 1.6.3.
EDIT2 :
json result
<pre>{{ res | json }}</pre>
result here
[
"[[\"suite1\",{\"id\":\"suite1\",\"description\":\"test cases\",\"fullName\":\"my cases\",\"failedExpectations\":[],\"status\":\"finished\",\"specs\":[{\"id\":\"spec0\",\"description\":\"should be able to create a room\",\"fullName\":\"should be able to add an unit\",\"failedExpectations\":[],\"passedExpectations\":[],\"pendingReason\":\"\",\"status\":\"passed\"}]},\"timestamp: Thu Apr 20 2017 09:47:38 GMT+0300 (EEST)\"]]"
]
i also created a small function that translate the array into an object:
function toObject(arr) {
let rv = {};
for (let i = 0; i < arr.length; ++i)
if (arr[i] !== undefined) rv[i] = arr[i];
return rv;
}
console.log(toObject(events));
$scope.res = toObject(events);
or
$scope.res = toObject(events);
made no difference
This, translate the data, into this:
Object {0: "[["suite1",{"id":"suite1","description":"RW - rate…tamp: Fri Apr 21 2017 11:45:06 GMT+0300 (EEST)"]]", 1: "[["suite1",{"id":"suite1","description":"rates","f…tamp: Fri Apr 21 2017 11:45:55 GMT+0300 (EEST)"]]", 2: "[["suite1",{"id":"suite1","description":"rates","f…tamp: Fri Apr 21 2017 11:46:12 GMT+0300 (EEST)"]]"}
