Help not work


#1

Please help :.
$http.get(‘http://verdauen.com/wp-json/wp/v2/posts’).then(function(res){
$scope.data = res.data;
$scope.datact = res.data.categories[0];
})
$http.get('https://verdauen.com/wp-json/wp/v2/posts?categories=’+$scope.datact).then(function(respon){
$scope.khal = respon.data;
})

Not work for $http.get($scope.datact)


#2

Try to replace your code with:

$http.get('http://verdauen.com/wp-json/wp/v2/posts').then(function(res){
$scope.data = res.data;
$scope.datact = res.data.categories[0];
})
$http.get('https://verdauen.com/wp-json/wp/v2/posts?categories='+$scope.datact).then(function(respon){
$scope.khal = respon.data;
})

#3

$http.get('https://verdauen.com/wp-json/wp/v2/posts?categories=’+$scope.datact).then(function(respon){
Hi Can you change above line like below


var link = ' https://verdauen.com/wp-json/wp/v2/posts?categories=’+$scope.datact;
$http.get(link).then(function(respon){

Note : $scope.datact Must be a single value like ‘100’ or product not like array or JSON