title: Angularjs code not working in Chrome
body: <p>I built my application using Angularjs and Laravel. I use Firefox for development and testing, so I did not notice this until it was brought to my attention. My application works only in Firefox but not Chrome or Chrome-based browsers, I am also unable to trace the source of the problem.</p>
  
  <p>I have a button directive that when clicked on executes a function to post data to the server, now this works fine in Firefox but not in Chrome, you would think that an issue like cross-browser compatibility not working would have something to do with client-side code but my application throws a 500 internal server error <strong>ONLY</strong> in Chrome or Chrome-based browsers.</p>
  
  <p>I tested the function by posting an alert inside and the function was indeed getting called. I then went to the server side and found the controller that processed the request, removed the code within the assigned function and simply just did a </p>
  
  <pre><code>return "hello";
  </code></pre>
  
  <p>That still did not work, kept getting the same error. Next, instead of using my button directive I just used a normal html button and once again, I got the same error. I have no idea what is going on or how to solve it.</p>
  
  <p>This is my function inside the controller:</p>
  
  <pre><code>$scope.event.addToCart = function(event, no_of_tickets, index) {
      $scope.selectedIndex = index;
      $scope.state = 'working';
  
      var req = {
          method: 'POST',
          url: '/buyEventTicket',
          headers: {
              'X-XSRF-Token': $("meta[name='csrf_token']").attr("content")
          },
          data: {
              event: event,
              no_of_tickets: no_of_tickets
          }
      }
  
      $http(req)
          .success(function (data, status, headers, config) {
  
              $rootScope.$broadcast('TICKET_ADDED', true);
  
              $scope.selectedIndex = -1;
              $scope.state = 'ready';
          })
          .error(function (data, status, headers, config) {
              // called asynchronously if an error occurs
              // or server returns response with an error status.
              //alert(data);
  
          });
  
  }
  </code></pre>
  
  <p>Previously, I checked to see what error was being thrown by the server and it was this:</p>
  
  <pre><code>DecryptException in Encrypter.php line 142: Invalid data.
  </code></pre>
  
  <p><strong>Note:</strong> Since I am unable to pinpoint exactly the cause of the error, I do not know which portion of my code is relevant here.</p>