Answer the question
In order to leave comments, you need to log in
How to get data using VK API in Angular?
I can not get data through the Vkontakte api. Here is the service:
app.factory('VkontakteCount', ['$http',
function($http) {
return {
fetchVk: function(callback) {
var methodName = 'groups.getMembers';
var groupID = 76922753;
var url = 'https://api.vk.com/method/'+methodName+'?group_id='+groupID+'&callback=JSON_CALLBACK';
$http.jsonp(url).success(function(response) {
callback(response.data);
});
}
}
}
]);
VkontakteCount.fetchVk(function(data){
$scope.vkcount = data;
});
Answer the question
In order to leave comments, you need to log in
$http.jsonp(url).success(function(response) {
callback(response.data);
});
$http.jsonp(url).success(function(response) {
console.log(response);
});
$http.jsonp(url).success(function(data) {
$scope.vkcount = data.response.count;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question