Get modal element in Angular 2 typescript
<p>How do you use document.getElementById to get a modal element? I'm trying to manually show and hide a modal via code in my home component typescript file. </p>

<p>I already have a working modal that works when a button is pressed - now I want to manually toggle the modal when certain conditions occur in code. </p>

<p>I have:</p>

<pre><code>var errorModalBox = document.getElementById("errorModal");
errorModalBox.modal('show');
</code></pre>

<p>However, the second line throws the following error:</p>

<pre><code>Property 'modal' does not exist on type 'HTMLElement'.
</code></pre>