Попробуйте это
Я создал глобальную конфигурацию модалов с let-c = "close" и let-d = "dismiss"
app.component.html
<div class="container-fluid">
<p>Welcome to {{ name }}</p>
<button type="button" (click)="openModal()">Click to open Modal</button>
<!-- Example 1: Passing TemplateRef as custom component -->
<ng-template #modal1 let-c="close" let-d="dismiss">
<app-modal [title]="'Title'" [c]="c" [d]="d">
<img src="https://angular.io/assets/images/logos/angular/angular.png" height="100px" width="100px">
</app-modal>
</ng-template>
</div>
modal.component.html
<div class="modal-header">
<h4 class="modal-title">{{title}}</h4>
<button type="button" class="close" aria-label="Close" (click)="d('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<ng-content></ng-content>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" (click)="c('Close click')">Cancel</button>
</div>
modal.component.ts
import { Component, Input, OnInit } from '@angular/core';
import {NgbModal, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-modal',
templateUrl: './modal.component.html',
styleUrls: ['./modal.component.css']
})
export class ModalComponent implements OnInit {
@Input() title = `Information`;
@Input() c;
@Input() d;
constructor(
public activeModal: NgbActiveModal
) {}
ngOnInit() {
}
}