Closed urielzen closed 5 years ago
@urielzen
When you're passing options to the modalService in a flat way (without any variable) you should use the first way:
this.modalRef = this.modalService.show(ModalComponent, { backdrop: true });
But if you're having a variable which contains your options, you should pass it as the second example:
const modalOptions = { backdrop: true};
this.modalRef = this.modalService.show(ModalComponent, modalOptions);
this.modalRef = this.modalService.show(ModalComponent, { backdrop: true });
Thanks for your answer, I understand what you are saying, I just wanted to point out that the documentation is incorrectly showing:
ng-uikit-pro-standard-7.4.4
I am trying to follow the example in the following link to create a modal https://mdbootstrap.com/docs/angular/modals/basic/
Everything seemed to be working fine, I could see the modal showing on button interaction. But when I get to the part "Inject data to the modal"...... the data is not being passed.
I fixed the problem as I was typing my question. The documentation shows to pass the modalOptions like this:
this.modalRef = this.modalService.show(ModalComponent, { this.modalOptions });
but for me it worked only passing it like this
this.modalRef = this.modalService.show(ModalComponent, this.modalOptions);