Ali
0
Q:

utiliser les données passees a un modal dans son propre composant en angular

const modalRef = this.modalService.open(ModalComponent);

modalRef.componentInstance.passedData= this.dataToPass;

modalRef.result.then(result => {
  //do something with result
}                                                       
0
export class ModalComponent { 

 passedData: typeOfData;     //declare it!

 someFunction() {     //or some  lifecycle hook 
  console.log(this.passedData)  //and then, use it!
 }

//rest of the ModalComponent 
}
0

New to Communities?

Join the community