title: AWS S3: No 'Access-Control-Allow-Origin' header is present on the requested resource
body: <p>In my <strong>angular</strong> app, I have the following error when I try to make an <strong>REST api</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/s1wyj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s1wyj.png" alt="enter image description here"></a></p>
  
  <p>My Code is given below: </p>
  
  <p><strong>Angular Controller</strong></p>
  
  <pre><code> $scope.saveTeam = function() {
  
      var club = {};
      club.name = $scope.selectedClub;
      var service = API.getService();
  
      service.create( {}, { club: club },
        function( res ) {
        }, function(err) {
          console.log("club err : ", err);
        });
  
    } 
  
  }
  </code></pre>
  
  <p><strong>Angular Factory</strong></p>
  
  <pre><code>  // Clubs service used for communicating with the coaches REST endpoint
   angular
     .module('app')
     .factory('API', ['$resource', 'session', function($resource, session) {
      var mainUrl = '/clubs';
  
      return {
          getService : function() {
              var token = session.getToken();
              return $resource(mainUrl, { }, {
                  createClub: {
                      method: 'POST',
                      url: mainUrl,
                      isArray: false,
                      headers: { 'Token': token }
                  }
              })
          }
      }
  });
  </code></pre>
  
  <p>How can I solve this error? Thanks in Advance.</p>