i want to close specific modal angular
Jump to turn (6)
- 1i want to close specific modal angular
- 2i have to models i want to close one of them
- 3this.modalService.close(this.vfCashContractModal)
- 4@ViewChild('uploadImageModal') uploadImageModal: TemplateRef ;
- 5i have more than one model i want to specify to close this
- 6@ViewChild('vfCashContractModal') vfCashContractModal: TemplateRef ; @ViewChild(
- User
i want to close specific modal angular
- Assistant
To close a specific modal in Angular, you can follow these steps:
- Create a reference to the modal in your component. You can use the
NgbModalRefclass from the@ng-bootstrap/ng-bootstrappackage.
typescriptimport { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; // ... // Declare a NgbModalRef variable modalRef: NgbModalRef; - Create a reference to the modal in your component. You can use the