title: AngularJS JSON parse(ajax)
body: <p>I have been tring to make a ajax request but there seems to be a problem. When my json attributes names are in " ( like {"name":value"} ), it works but when attribute names are not. I have following excepiton </p>
  
  <pre><code>SyntaxError: Unexpected token s
  at Object.parse (native)
  at pb (http://localhost:8080/angularjs/lib/angular.min.js:12:472)
  at Vc.d.defaults.transformResponse (http://localhost:8080/angularjs/lib/angular.min.js:92:314)
  at http://localhost:8080/angularjs/lib/angular.min.js:92:127
  at Array.forEach (native)
  at n (http://localhost:8080/angularjs/lib/angular.min.js:6:192)
  at Qb (http://localhost:8080/angularjs/lib/angular.min.js:92:109)
  at c (http://localhost:8080/angularjs/lib/angular.min.js:93:295)
  at h (http://localhost:8080/angularjs/lib/angular.min.js:77:437)
  at http://localhost:8080/angularjs/lib/angular.min.js:78:169 
  </code></pre>
  
  <p>Here is my code:</p>
  
  <p>index.html:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app&gt;
  &lt;head&gt;
  &lt;script src="lib/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/indexApp.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          &lt;div ng-controller="AjaxController"&gt;
              {{users.data}}
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>indexApp.js</p>
  
  <pre><code>function AjaxController($scope, $http) {
  $scope.beers = [ 0, 1, 2, 3, 4, 5, 6 ];
  console.log("OMW");
  $http({
      method : 'GET',
      url : 'data.json'
  }).success(function(data, status, headers, config) {
      $scope.users = data;
  }).error(function(data, status, headers, config) {
      $scope.users = "error" + data;
  });
  </code></pre>
  
  <p>};</p>
  
  <p>data.json</p>
  
  <pre><code>{
      success : "true",
      data: [{name:"val"}]
  }
  </code></pre>