I used the modal from ng-bootstrap
In my parent component i used modalService
to open the modal, and i sent data to the modal using componentInstance
.
In the modal component i used ngOnChanges
to get the data that i sent. but the ngOnChanges
is not trigged.
parent component
public toAttach(): void {
let modalRef = this.modalService.open(HelloComponent);
modalRef.componentInstance.attachments = this.attachments;
}
modal component
ngOnChanges(changes: SimpleChanges) {
console.log("start!");
if (changes["attachments"] && changes["attachments"].currentValue) {
console.log(changes["attachments"].currentValue);
}
}