Answer the question
In order to leave comments, you need to log in
Angular2: How to properly push ng-bootstrap modal to child component?
Good day,
I can’t fully understand ng2-bootstrap, namely modal. If in one component, then everything is easy, but if you put the modal into a separate component (child), then it doesn’t work.
Maybe someone has already done these manipulations?
Answer the question
In order to leave comments, you need to log in
In general, who will need it or just be interested. Implemented.
Let's say the selector is: "test-modal". Then, where it will be necessary to display this modal window, we write:
and we hang an event on the button:
in the modal window component we write:
@ViewChild('testModal') public testModal: ModalDirective;
public showTestModal(): void {
this.testModal.show();
}
public hideTestModal(): void {
this.testModal.hide();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question