javascript - AngularJS youtube api search error -


when search sent 401(unauthorized) error. error goes away when refresh page whole bunch of times gives error. if open error link in new tab shows formatted data( search results) i'm trying get.

here search function looks like

$scope.search = function () { $http.get('https://www.googleapis.com/youtube/v3/search',{   params: {     key: 'my_api_key_here',     type: 'video',     maxresults : '12',     part: 'id, snippet',     fields: 'items/id,items/snippet/title,items/snippet/description,items/snippet/thumbnails/default,items/snippet/channeltitle',     q: this.query   } }) .success( function (data) {   $scope.search_results = youtubeservice.listresults(data);   $scope.query = ""; }) .error( function (){   $log.info('search error');   $scope.query = ""; }); 

};


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -