const modalRef = this.modalService.open(ModalComponent); modalRef.componentInstance.passedData= this.dataToPass; modalRef.result.then(result => { //do something with result }
export class ModalComponent { passedData: typeOfData; //declare it! someFunction() { //or some lifecycle hook console.log(this.passedData) //and then, use it! } //rest of the ModalComponent }