I want to show json data into a table, but its showing the result as below shown. How to show json data in table in angular js.
userid {{x.userid}}
status {{x.status}}
Desired output:
userid 0000acfffe731122
status 3
Json data:
{
"userid":"0000acfffe731122",
"status":3
}
<table>
<tr>
<td>
device id
</td>
<td>
{{names.userid}}
</td>
</tr>
<tr>
<td>
device status
</td>
<td>{{names.status}}</td>
</tr>
</table>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http.get('https://example.com/abc', {
headers: { 'Authorization': 'Basic a2VybmVsc==' }
})
.then(function(response) {
$scope.names = response.data;
});
});
</script>
ng-repeat?