How should i pass data between multiple modals?


#1

Hello everyone. I am using modals to fill in data from users, but the thing is i need alot of data from users, so to not make it uncomprehensive, i use multiple modals which can be cycled through, the thing is that everytime i switch modal i want to pass the data from the old modal to the new modal. How do i achieve this?

let formList = [
  {
    form1: formBuilder.group({
    profilePic: [''],
    name: ['', Validators.required],
    email: ['', Validators.required],
    phone: ['', Validators.required],
    date: [''],
  })},
  {form2: formBuilder.group({
    brand: ['', Validators.required],
    batch: ['', Validators.required],
    name: ['', Validators.required],
    lot: ['', Validators.required],
  })},
  {Form3: formBuilder.group({
    brand: ['', Validators.required],
    batch: ['', Validators.required],
    name: ['', Validators.required],
    lot:  ['', Validators.required],
  })}]

When clicking continue i ofcourse want to pass the data:

let addModal = this.modalCtrl.create(‘ItemCreatePage’, {formlist: this.formList});

but this doesn’t work too good.