<html ng-app id="customersApp">
<head>
<title>RESTful JSON Parsing using AngularJs Tutorials - 1</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.jsonp('http://public-api.wordpress.com/rest/v1/sites/wtmpeachtest.wordpress.com/posts?callback=JSON_CALLBACK')
.success(function(data) {
$scope.value = data;
console.log(data.found);
console.log(data.posts[0].author.name);
});
}
</script>
</head>
<body>
<h1>RESTful JSON Parsing using AngularJs</h1>
<div ng-controller="CustomersController">
<br/>
</div>
</body>
</html>
Error: PG::DuplicateTable: ERROR: relation "taggings" already exists Solution : Already the table present in your database.But migration also trying to create a table in database.For this reason error occurred. So try to remove the table (taggings) from your database. postgresql : > DROP TABLE IF EXISTS taggings; Rails console : > ActiveRecord::Migration.drop_table(:taggings)
Comments
Post a Comment