I want to get the same reference of BsModalRef inside a service. Is it possible ?
openModal() {
this.bsModalRef = this.modalService.show(SomeComponent, {
initialState: {
title: 'Modal title',
data: {},
},
});
console.log(this.modalRef); // this gives the opened modal reference
this.service.mimic(); // this return a new instance of the bsModalRef service.
}
this is service.mimic
mimic() {
console.log(this.bsModalRef);
}