I have an Angular 4 page with a ng-bootstrap modal. My code is shown below.
foo.html
[...]
<button class="btn btn-sm btn-secondary material-icons"
(click)="open(content)">search</button>
<ng-template #content let-c="close" let-d="dismiss">
content in here
</ng-template>
[...]
foo.ts
[...]
constructor(private modalService: NgbModal) { }
[...]
open(content) {
let options: NgbModalOptions = {
size: 'lg'
};
this.modalService.open(content, options);
}
[...]
When I click the button, the modal opens. Now, I want to open the modal on ngChanges.
ngOnChanges(changes: any) {
open(content)
}
My issue is: How can I access the "content" here? Is there a way to get the ng-template programmatically? Thank you in advance!