Javascript 离子模式的角通输入

Javascript 离子模式的角通输入,javascript,angular,typescript,ionic4,Javascript,Angular,Typescript,Ionic4,我有一个接受输入参数的组件: export class MapComponent implements OnInit { @Input() options: MapOptions<any>; } 另外,我在页面中存储了mapOptions,我想通过它 我可以将我的mapOptions传递给Modal,以便组件将其作为输入吗?我假设您使用的是Ionic,因为这与Ionic的ModalController的实现相同 根据他们的要求,可以通过传递到组件props: async pi

我有一个接受输入参数的组件:

export class MapComponent implements OnInit {
   @Input() options: MapOptions<any>;
}
另外,我在页面中存储了mapOptions,我想通过它


我可以将我的mapOptions传递给Modal,以便组件将其作为输入吗?

我假设您使用的是Ionic,因为这与Ionic的ModalController的实现相同

根据他们的要求,可以通过传递到
组件props

async pickLocationModal() {
  const modal = await this.modalController.create({
    component: MapComponent,
    componentProps: { // <----------
      options: ...
    }
  });
  return await modal.present();
}
async pickLocationModal(){
const modal=等待this.modalController.create({
组件:MapComponent,

组件支持:{//你的问题一点也不清楚。
modalController
是什么?是你的模态实现吗?哦,对不起,我用的是ionic,我觉得它是内置在角度上的,我忘了。谢谢,直到你这么说我才意识到它是ionics。过了时间限制,我会把这个答案标记为正确的
async pickLocationModal() {
  const modal = await this.modalController.create({
    component: MapComponent,
    componentProps: { // <----------
      options: ...
    }
  });
  return await modal.present();
}