Just starting out with angular4 and incorporating bootstrap modal into my project. I want the modal to close when clicking outside of it. Here's the code snippet:
//in html
<div bsModal #noticeModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myLargeModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
Hello World
</div>
</div>
</div>
// in ts code
@ViewChild('noticeModal') public noticeModal: ModalDirective;
ngAfterViewInit() {
this.noticeModal.show();
};