I am currently utilizing Angular and have a webpage where I need to send data to another page.
- Transmit an array of selected values
Generate multiple records (associating with a model)
this.activatedRoute.data.subscribe(({ model] }) => { setTimeout(() => { this.ngbModalRef = this.modalService.open(... as Component, { size: 'lg', backdrop: 'static' }); this.ngbModalRef.componentInstance.model = model; this.ngbModalRef.result.then( result => { console.log(result); // this.router.navigate(['/order', { outlets: { popup: null } }]); //this.ngbModalRef = null; }, reason => { console.log(reason); // this.router.navigate(['/order', { outlets: { popup: null } }]); //this.ngbModalRef = null; } ); }, 0); }); this.activatedRoute.params.subscribe((params: any) => { setTimeout(() => { this.ngbModalRef = this.modalService.open(... as Component, { size: 'lg', backdrop: 'static' }); this.ngbModalRef.componentInstance.listOfNum = params['listOfNum']; this.ngbModalRef.result.then( result => { this.router.navigate(['/order', { outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' }); this.ngbModalRef = null; }, reason => { this.router.navigate(['/order', { outlets: { popup: null } }], { replaceUrl: true, queryParamsHandling: 'merge' }); this.ngbModalRef = null; } ); }, 0); });
Please provide guidance on how to retrieve both messages. So far, I have only managed to access the model data in this manner.