editor-componentから関数を格納するサービスを使用しようとします。 モーダルはやや難しくなります。ブートストラップデモのコード:
<button type="button" class="btn btn-primary" (click)="showModal()">Open a modal</button>
<pre *ngFor="let message of messages">{{message}}</pre>
<div class="modal fade" bsModal #modal="bs-modal" tabindex="-1" role="dialog"
aria-labelledby="mySmallModalLabel" aria-hidden="true"
(onShow)="handler('onShow', $event)"
(onShown)="handler('onShown', $event)"
(onHide)="handler('onHide', $event)"
(onHidden)="handler('onHidden', $event)">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title pull-left">Modal</h4>
<button type="button" class="close pull-right" aria-label="Close" (click)="modal.hide()">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Just another modal <br>
Click <b>×</b>, press <code>Esc</code> or click on backdrop to close modal.
</div>
</div>
</div>
</div>
このモーダルはコンポーネントスコープの内側です。この#modal = "bs-modal"では変数 "modal"を使用してモーダルのコンテキストを使用することができます 詳細http://valor-software.com/ngx-bootstrap/#/modals
親子関係ではないため、コンポーネント間の通信に共有サービスを使用する必要があります。 – Ploppy