angularjs - angular.js and untappd API, how to send a Get request -


good morning all. first question here forgive me if dumb question!

i'm trying connect untappd api trought angular.js; api docs says

whenever making call api, must pass both client id , client secret params below http://api.untappd.com/v4/method_name?client_id=clientid&client_secret=clientsecret

with angular have done controller

function untappdcontroller($scope,$http) { $http.get('http://api.untappd.com/v4/user/badges/jonnyjava?client_id=xxx&client_secret=xxx').success(function(data) {     alert('ok');  }). error(function(data, status, headers, config) {     alert('ko'); }); } untappdcontroller.$inject = ['$scope', '$http']; 

but doesn't work. (i ko)

so i'have tried tro restful service. in way

angular.module('badgeservices', ['ngresource']). factory('badge', function($resource){   return $resource('http://api.untappd.com/v4/user/badges/jonnyjava/', {}, {     query: {method:'get',params:{client_id: 'xxx', client_secret: 'xxx'}, isarray:true}   }); }); 

but doesn't works too... i'm doing wrong? i'm new angular. looks simple i'm missing fundamental... thank you!

the error function passed these variables: data, status, headers, config. check contents - i'm sure server has why of specifying went wrong.


Comments