title: function call on clicking NgbModal backdrop. anuglar 2 modal
body: <p>I am trying to make a function (Let's say 'randomFunction') call on clicking the backdrop (shaded part) of the modal used in <code>angular2</code> using <code>NgbModal</code>.</p>
  
  <p>Here is the <code>companyNumberComponent.html</code>:  </p>
  
  <pre><code>&lt;company-numbers-list (companyNumberModal)="modalService.open(companyNumberModal);"&gt;&lt;/company-numbers-list&gt;
  
  &lt;template ngbModalContainer #companyNumberModal let-c="close" let-d="dismiss" id="companyNumberModal"&gt;
      &lt;div class="modal-body"&gt;
          &lt;company-number-modal&gt;&lt;/company-number-modal&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer text-center"&gt;
          &lt;mi-button [type]="'info'" id="number_flow_close" [raised]="true" aria-label="close" (click)="c('Close click');
          "&gt;Close&lt;/mi-button&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>here is the <code>companyNumberComponent.ts</code> file:  </p>
  
  <pre><code>@Component
   .....
   export class companyNumberComponent(){
       constructor(private modalService: NgbModal){}
       public randomFunction(){
           console.log("hi");
       }
   }
  </code></pre>
  
  <p>Can someone please suggest me how to proceed in this or how to call this <code>randomFunction()</code> in the <code>dismiss()</code> or <code>close()</code> function of the modal.</p>