Ionic 3如何从一页接收数​​组到另一页

Ionic 3 how to receive an array from one page to another page

我需要将数组从一页传递到另一页。在第一页中,数组是通过从列表中选择项目创建的,它可以推送所有项目,但是当我在另一页中收到这个数组时,它变成了一个数组对象,我无法读取 html 中的数据页面,这是我的代码的一部分:

labo.ts - 这是我创建数组的方式,它很好

selectItem(itemKey){
   const foundAt = this.selectedQuestions.indexOf(itemKey);
   if (foundAt >= 0) {
      this.selectedQuestions.splice(foundAt, 1);
   } else {
      this.selectedQuestions.push(itemKey);
   }
  console.log(this.selectedQuestions);

}

当我完成添加项目后,我将其发送到 calendar.ts

calendar(){
 console.log("ARRAY ", this.selectedQuestions)
    this.navCtrl.push(CalendarioPage,{
      queryParams: {
           value : this.selectedQuestions
       },
  });

}

这里是calendaar.ts,我需要在这里接收数组:

 export class CalendarioPage {
  datos: Array<object>;

  constructor(public navCtrl: NavController, public navParams: NavParams,
    public http: Http, private conteSearch : ContesearchProvider) {

    this.datos = navParams.get("queryParams");

    console.log("array -> ", this.datos)

  }  
 }

在我的 calendar.html 文件中,我尝试读取数组:

<div *ngFor="let dato of datos">
  {{dato.nombre}} 
</div>

我收到此错误 "ERROR Error: "未捕获(承诺):错误:找不到类型 'object' 的不同支持对象“[object Object]”。 NgFor 仅支持绑定到 Iterables,例如 Arrays。"

这是数组前后的样子(在 calendar.ts 中收到)

提前感谢您的任何想法!

您传递的数组在对象的值键处可用 this.datos

所以你需要像 this.datos.value 那样阅读它,那应该行得通。

谢谢