title: Angular2 - how to destructure a Rails json error response into a string
body: <p>An error response from a Rails API gives me this json body:</p>
  
  <p>{"mobile":["is already taken"],"email":["is already taken"]}</p>
  
  <p>As you can see, each field can have an array of error messages associated with it.</p>
  
  <p>I am trying to 'deconstruct' this into a simple string:</p>
  
  <p>"mobile is already taken, email is already taken"</p>
  
  <p>I was trying to use map and provide it with a function. Obviously I need to account for the fact that there could be several elements in these arrays, eg:</p>
  
  <p>{"mobile":["is already taken","must start 07 for UK"],"email":["is already taken"]}</p>
  
  <p>which should then become:</p>
  
  <p>"mobile is already taken, mobile must start 07 for UK, email is already taken"</p>