title: Angular.js and WebApi which returns int array
body: <p>For testing with angular I've a Webapi method which returns an instance of an object that conatins a List. (The json output can be seen below)</p>
  
  <p>Now in my angular controller i want to retrieve this object.</p>
  
  <p>Does anyone have a hint what I'm doing wrong?</p>
  
  <p>RestResource as <strong>factory</strong></p>
  
  <pre><code>myngApp.factory("valueResource", function ($resource) {
  
      var result =
          {
              database: $resource("/api/values")
          }
  
      return result;
  });
  </code></pre>
  
  <p><strong>Controller</strong>:</p>
  
  <pre><code>myngApp.controller("dataController", function ($scope, settings, valueResource) {
      $scope.message = "Hello World!";
      $scope.userName = settings.user;
  
  
      $scope.restValues = valueResource.database.query({});
  });
  </code></pre>
  
  <p>the <strong>json response</strong> (taken with fiddler) is this:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Cache-Control: no-cache
  Pragma: no-cache
  Content-Type: application/json; charset=utf-8
  Expires: -1
  Server: Microsoft-IIS/8.0
  X-AspNet-Version: 4.0.30319
  X-SourceFiles: =?UTF-8?B?RDpca2lsblxleHBlcmltZW50YWxcc3JjXG5nMlxXZWJBcHBsaWNhdGlvbjFcV2ViQXBpXHZhbHVlcw==?=
  X-Powered-By: ASP.NET
  Date: Mon, 17 Feb 2014 14:47:35 GMT
  Content-Length: 19
  
  {"Items":[1,2,3,4]}
  </code></pre>
  
  <p>Console output is:</p>
  
  <pre><code>XHR finished loading: "http://localhost:55671/api/values". angular.js:8013
  Error: [$resource:badcfg] http://errors.angularjs.org/1.2.12/$resource/badcfg?p0=array&amp;p1=object
      at Error (native)
      at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:6:450
      at p.then.m.$resolved (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular-resource.min.js:8:517)
      at A (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:93:5)
      at A (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:93:5)
      at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:94:173
      at h.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:102:456)
      at h.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:100:218)
      at h.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:103:264)
      at f (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js:67:120) angular.js:9435
  </code></pre>