Hook to bootstrap 4 modal show / hide events from Typescript
问题 Having a modal with id myModal I'm trying to hook up to events when it shows and closes. Following the documentation of https://v4-alpha.getbootstrap.com/components/modal/#events I have added the following to my modal component: this.modalElement = document.getElementById("myModal"); this.modalElement.addEventListener("hidden.bs.modal", this.onModalHidden); this.modalElement.addEventListener("shown.bs.modal", this.onModalShown); The event handlers for now will only console.log "shown" or