The console shows that the posts were retrieved successfully, the backend works fine without the angular compatibility.
and its supposed to retrieve post data.
angular.js:12701 XHR finished loading: GET "http://127.0.0.1:8000/auth/posts".
however it shows 5 empty divs like the following
main.js
$http.get('/auth/posts').then(function(data){
$scope.myposts = data;
});
PostController
public function getPosts()
{
$posts = Post::all();
return json_encode($posts);
}
Route
Route::get('auth/posts', 'HomeController@getPosts');
the html file
<div id="mypost" class="col-md-8 panel-default" ng-repeat="post in myposts">
<div id="eli-style-heading" class="panel-heading"><% post.title %></div>
<div class="panel-body panel">
<figure>
<p> <% post.body %></p>
</figure>
</div>
</div>