Answer the question
In order to leave comments, you need to log in
How to correctly link from post list to one post Angular Js + Wp Rest Api?
Good afternoon.
Prompt or give an example please: how to properly call a specific entry from the list of entries.
Here is my controller that calls posts to the page:
.controller('eventsCtrl', function($scope,$http) {
$scope.posts = [];
var wordpressUrl = "http://nn.allsay.kz/wp-json/wp/v2/posts?categories=19";
$http.get(wordpressUrl)
.success(function(response){
console.log("Reveived getPosts via HTTP: ", response, status);
angular.forEach(response, function(child){
$scope.posts.push(child);
});
})
.error(function(response, status){
console.log("Error while received response. " + status + response);
});
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question