title: How to assign data from response objects to object
body: <p>Hi guys I want to ask you about verry basic question, my API server is returning <a href="https://i.stack.imgur.com/JsEVL.png" rel="nofollow noreferrer">response from server</a></p>
  
  <p>In my angular service I am making successfull request to get this data from server:</p>
  
  <pre><code>get() {
          return this._$http({
              url: `${this._AppConstants.api}/calendar`,
              method: 'GET'
          }).then(
              (res) =&gt; {
                   let events = [];
                   return res.data;
              }
          )
      }
  </code></pre>
  
  <p>But I want to assign response to my <code>events</code> object. Let's say my server is returning (as you can see in the screenshot) the objects but I want to transform them to look something like this:</p>
  
  <pre><code>{
  title: res.data.description,
  startsAt: res.data.startdate,
  endsAt: res.data.enddate
  }
  </code></pre>
  
  <p>I dont have any idea how to transform the objects from server to working arrays</p>