Currently, I am attempting to trigger a bootstrap Modal in Angular by utilizing the component instead of its HTML attribute. However, I am encountering an error (specifically, illegal invocation).
Here is the code snippet from the component:
@ViewChild('myModal') div: any;
ngAfterViewInit() {
let bs = new bootstrap.Modal(this.div);
}
This is the related HTML code:
<div class="modal-content" #myModal>...</div>