Answer the question
In order to leave comments, you need to log in
How to open bootstrap modal from parent component?
There is a Bootstrap modal window (in an Angular 2+ project):
<div bsModal #largeModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
(click)="largeModal.show()"
Answer the question
In order to leave comments, you need to log in
I do it like this:
<button type="button" class="btn btn-sm btn-outline-success" (click)="openVerticallyCentered(content)">Create new</button>
<ng-template let-c="close" let-d="dismiss" #content>
<app-create-single-form [book]="activeBook" [user]="activeUser" [c]="c" [d]="d"></app-create-single-form>
</ng-template>
openVerticallyCentered(content): void {
this.modalService.open(content, {centered: true, size: 'lg'});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question