I do not want to use angular2-bootstrap or ng2-bs3-modal as suggested in the questions/answers Angular 2 Bootstrap Modal and Angular 2.0 and Modal Dialog
Now. I know what opens and closes the bootstrap modal.
- The display is toggled between
display: none;
anddisplay: block;
- An attribute toggles on the
div
betweenaria-hidden="true"
andaria-hidden="false
So, naturally I thought that if I bound to the aria-hidden
attribute like so [aria-hidden]="true"
, that I could manipulate it. Sadly though, I cannot bind to aria-hidden
since it isn't a known property of div
. (note, attr.aria-hidden
doesn't exist)
I do know that this is possible with JQuery with $('#myModal').modal()
as shown in this question How to open a Bootstrap modal window using jQuery?
So my question is, is there a TypeScript functionality that does the same thing as modal()
from JQuery, or is there a way to bind a function/variable to aria-hidden
?
My current html
:
<div id="createAccountModal" class="modal fade customForm" role="dialog" [aria-hidden]="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4>Create account</h4>
</div>
<div class="modal-body">
<p>Lorem ipsum</P>
</div>
<div class="modal-footer align-left">
My custom footer
</div>
</div>
</div>
</div