title: How to programmatically close ng-bootstrap modal?
body: <p>I've got a modal:</p>
  
  <pre><code>&lt;template #warningModal let-c="close" let-d="dismiss"&gt;
    &lt;div class="modal-header"&gt;
      &lt;button type="button" class="close" aria-label="Close" (click)="d('Cross click')"&gt;
        &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
      &lt;/button&gt;
      &lt;h4 class="modal-title"&gt;Warning&lt;/h4&gt;
    &lt;/div&gt;
    &lt;div class="modal-body"&gt;
        The numbers you have entered result in negative expenses.  We will treat this as $0.00.  Do you want to continue?
    &lt;/div&gt;
    &lt;div class="modal-footer"&gt;
      &lt;button type="button" class="btn btn-secondary" (click)="c('Close click')"&gt;No&lt;/button&gt;
      &lt;button type="button" class="btn btn-secondary" (click)="submit()"&gt;Yes&lt;/button&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>Whenever I click yes, I want it to call a function and close itself.<br>
  In my controller, I have <code>@ViewChild('warningModal') warning;</code> and in <code>submit()</code>, I have <code>this.warning.close();</code>, but I get <code>this.warning.close is not a function</code> whenever I click Yes. </p>
  
  <p>How do I get this to work the way I want it to?</p>