title: How to pass an array of objects to a modal page in Ionic?
body: <p>I have an array of objects </p>
  
  <pre><code>cart = [{name: 'Test', description: 'Test'}, {name: 'Test', description: 'Test'}];
  </code></pre>
  
  <p>I want to pass this to a modal page when a button is clicked. My code is set up as such: </p>
  
  <pre><code>openCart(){
      let data = this.cart;
      let modal = this.modalCtrl.create(CartPage, data);
      modal.present();
  }
  </code></pre>
  
  <p>In the modal page I'm trying to get log the data as</p>
  
  <pre><code>console.log(navParams.get('data'));
  </code></pre>
  
  <p>But this returns my data as undefined. How can I pass an array of objects from my homepage to my modal page and retrieve the data? Ideally I would like to store the data passed into a variable and show 'name' and 'description' on the html view page. </p>