Iam fetching data from database in a JSON format using web services. Now i need to present the json format into normal string in the view part of my AngularJS.
This my HTML file index.html
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<script src="./hello.js"></script>
</head>
<body ng-controller="Hello">
<div ng-repeat="greeting in greetings">
<p>The ID is {{greeting.userId}}</p>
<p>The content is {{greeting.userName}}</p>
</div>
</body>
`
This is my java Script file hello.js
function Hello($scope, $http) {
$http.get('http://localhost:8080/RESTJerseyExample/rest/restfultest/GetCarValues').
success(function(data) {
$scope.greetings = data;
});
}`