I'm trying to load data into my angular module from json file but instead of data i'm getting this.
var app = angular.module('myApp', []);
app.controller("myCtrl",function($scope, $http)
{
$http.get('bookData.json').then(function(response){
$scope.books = response.data;
});
});
And in my view displaying data as:
<body ng-controller="myCtrl">
<div>{{"Book details"}}</div>
<div>
<table>
<tr ng-repeat="x in books">
<td>x.bookid</td>
<td>x.author</td>
</tr>
</table>
</div>
<script data-require="[email protected]" src="https://code.angularjs.org/1.5.8/angular.js" data-semver="1.5.8"></script>
<script src="app.js"></script>
</body>
</html>
But i'm getting output as:
Book details
x.bookid x.author
x.bookid x.author
x.bookid x.author
x.bookid x.author