I am trying to use a Bootstrap modal in an Angular application using classes in HTML, but it not working - its not showing as a modal
<div class="modal text-center" *ngIf="showmodal" tabindex="-1" id="withScrollExampleModal">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title fw-normal">Basic dialogue title</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
<i class="fa-light fa-circle-xmark"></i>
</button>
</div>
<div class="modal-body f-14">
<p>Lorem ipsum dolor sit amet consectetur. Enim libero commodo nibh vitae sed laoreet magna dui pharetra.
</p>
</div>
<div class="modal-footer d-flex justify-content-center">
<button type="button" class="btn btn-secondary rounded-pill" data-bs-dismiss="modal">Action 1</button>
<button type="button" class="btn btn-outline-primary rounded-pill">Action 2</button>
</div>
</div>
</div>
</div>
Bootstrap has build in functions to open and close modals. For example there is a button that should open a modal, in that button there needs to be a data toggle like
data-toggle="modal"and the target id of the modal likedata-target="#Id of the modal"Further the modal itself hass to have a class called "modal" and a id. This id has to be the same as the data-target. Here is an example of a modal.For this to work make sure to import the following items in the head
For more information on modals in bootstrap go to the following link https://getbootstrap.com/docs/4.0/components/modal/