title: result.data.data.map is not a function
body: <p>There are similar questions like this , but I didn't find a better solution. I'm calling an API from my Angular JS client side like this</p>
  
  <pre><code>    export default function (
    $http,
    API_URL
  ) {
    'ngInject'
  
    const service = {}
  
    service.searchAddresses = function (searchTerm) {
      return $http.get(`${API_URL}/names/?beginning=${searchTerm || ''}`)
        .then((result) =&gt; {
  
          return result.data.data.map((address) =&gt; address.attributes.display) 
        })
    }
  
    return service
  }
  </code></pre>
  
  <p>In client side, when I console log the result it look like this</p>
  
  <pre><code>{"data":{"data":{"type":"address","attributes":[{"address":"5-7 east street, lidcombe, nsw 2141","display":"5-7 East Street, LIDCOMBE, NSW 2141"},{"address":"5-7 mary street, auburn, nsw 2144","display":"5-7 Mary Street, AUBURN, NSW 2144"},{"address":"5-7 nicholas street, lidcombe, nsw 2141","display":"5-7 Nicholas Street, LIDCOMBE, NSW 2141"}]}}
  </code></pre>
  
  <p>Then, in API side, network response is like this.</p>
  
  <pre><code>    {
    "data": {
      "type": "address",
      "attributes": [
        {
          "address": "5-7 east street, lidcombe, nsw 2141",
          "display": "5-7 East Street, LIDCOMBE, NSW 2141"
        },
        {
          "address": "5-7 mary street, auburn, nsw 2144",
          "display": "5-7 Mary Street, AUBURN, NSW 2144"
        },
        {
          "address": "5-7 nicholas street, lidcombe, nsw 2141",
          "display": "5-7 Nicholas Street, LIDCOMBE, NSW 2141"
        }
      ]
    }
  }
  </code></pre>
  
  <p>I'm getting an error in client side when I try to retrieve above data. Error is result.data.data.map is not a function</p>