title: How to use HTTP.GET in AngularJS correctly? In specific, for an external API call?
body: <p>I have the following code in the controller.js, </p>
  
  <pre><code>var myApp = angular.module('myApp',[]);
  
  myApp.service('dataService', function($http) {
  delete $http.defaults.headers.common['X-Requested-With'];
  this.getData = function() {
      $http({
          method: 'GET',
          url: 'https://www.example.com/api/v1/page',
          params: 'limit=10, sort_by=created:desc',
          headers: {'Authorization': 'Token token=xxxxYYYYZzzz'}
       }).success(function(data){
           return data
      }).error(function(){
          alert("error");
      });
   }
  });
  
  myApp.controller('AngularJSCtrl', function($scope, dataService) {
    $scope.data = dataService.getData();
  });
  </code></pre>
  
  <p>But, I think I m probably making a mistake with CORS related issue. Can you please point me to the correct way to make this call? Thanks much!</p>