REST mean Representational State Transfer
<html ng-app id="customersApp">
<head>
<title>RESTful JSON Parsing using AngularJs Tutorials</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
function CustomersController($scope, $http) {
$http.get('http://public-api.wordpress.com/rest/v1/sites/wtmpeachtest.wordpress.com/posts')
.success(function (data) {
console.log(data.found);
console.log(data.posts[0].site_ID);
console.log(data.posts[0].author.name);
console.log(data.posts[0].author.URL);
alert("Author URL : " +data.posts[0].author.URL)
});
}
</script>
</head>
<body>
<h1>RESTful JSON Parsing using AngularJs</h1>
<div ng-controller="CustomersController">
<br/>
</div>
</body>
</html>
Comments
Post a Comment