title: Angular NgbModal, how to correctly close a modal window?
body: <p>I am working on an Angular application using <strong>NgbModal</strong> to handle modal. I have some doubts about how properly close a modal implemented with this component (untill now I always used PrimeNg instead <strong>ng-bootstrap</strong>).</p>
  <p>Basically I have done in this way (and it seems to works fine): into my TypeScript code I have something like this:</p>
  <pre><code>async post(): Promise&lt;void&gt; {
      this.submitted.next(true);
      try {
        await this.setAddress();
        this.modalService.dismissAll();
      } catch (e) {
        console.error('Storage upload error', e);
        this.submitted.next(false);
      }
  }
  </code></pre>
  <p>Basically this method is called when a post is submitted. The <strong>setAddress()</strong> method save on the database (calling another service method) the form values. Then the modal was closed. It seems to works fine but I have the following doubt:</p>
  <p>As you can see in order to close my modal I am using this <strong>dismissAll()</strong> method. Checking on the documentation: <a href="https://ng-bootstrap.github.io/#/components/modal/api" rel="nofollow noreferrer">https://ng-bootstrap.github.io/#/components/modal/api</a></p>
  <p>It also indicates a <strong>close()</strong> method that I can not use on my code. Trying:</p>
  <pre><code>this.modalService.close();
  </code></pre>
  <p>the IDE says to me:</p>
  <blockquote>
  <p>Property 'close' does not exist on type 'NgbModal'.ts(2339)</p>
  </blockquote>
  <p>Why in the official documentation I have this method but not in my code? The first used method (<strong>dismissAll()</strong>) is it correct? It is working but I have some doubts related to this &quot;All&quot; into the method name. Why &quot;All&quot;? it let me think that it is closing all the modals and not only a single one (in my use case in my page there is only a single modal so it is indifferent but I am not sure that I am implementing the correct logic to close my modal)</p>