Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $http.get('http://api.discogs.com/artists/' + $scope.artist.id + '/releases?page=' + $scope.nextPage + '&per_page=8').then(function(data2) {
- $scope.nextPage = $scope.nextPage + 1;
- if($scope.nextPage > data2.data.pagination.pages){
- $scope.morePages = false;
- }
- $scope.releases = $scope.releases.concat(data2.data.releases);
- })
- .finally(function(){
- $scope.loading = false;
- });
- $http({method: 'GET', url: 'http://localhost:3000/api/symbol/junk',
- headers:{
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
- 'Access-Control-Allow-Headers': 'Content-Type, X-Requested-With',
- 'X-Random-Shit':'123123123'
- }})
- .success(function(d){ console.log( "yay" ); })
- var makeCall = function(artistId,etc...,callBackFunc){
- var config={method: 'GET',
- url: 'http://api.discogs.com/artists/',
- params:{artistId:artistId,etc....}
- headers:{
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
- 'Access-Control-Allow-Headers': 'Content-Type, X-Requested-With',
- 'X-Random-Shit':'123123123'
- }};
- $http(config).then(function(data){
- callBackFunc(data);
- })
- }
- myService.makeCall(artistId, other parameters such as page no,.....,function(data2){
- $scope.nextPage = $scope.nextPage + 1;
- if($scope.nextPage > data2.data.pagination.pages){
- $scope.morePages = false;
- }
- $scope.releases = $scope.releases.concat(data2.data.releases);
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement