I want to print just the id of users JSON file {{item.id}} but it doesn't work, i can not understand where is the problem. i think the problem is in $http.get(urls).then()
but but i don't know how can i fixed this.
IF I write like this {{item}} it will work.
var app = angular.module("myApp", []);
app.controller("controller", function($scope, $http) {
var url = "https://jsonplaceholder.typicode.com/users";
$http.get(urls).then(function(response) {
$scope.users = response;
});
});
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>AngularJa | app</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script>
<script type="text/javascript" src="javascript/main.js"></script>
</head>
<body ng-controller="controller">
<table class="table table-striped">
<tr ng-repeat="item in users">
<td>{{item.id}}</td>
</tr>
</table>
</body>
</html>