ngDialog - how to close dialog from the template (i.e. no controller functions)?
<p>On ngDialog (<a href="https://github.com/likeastore/ngDialog" rel="nofollow">https://github.com/likeastore/ngDialog</a>), is there a built in way to close a dialog from within the template it self? I.e. so I don't need any functions in the controller calling the dialog?</p>

<p>This is my template (errorPopup.html):</p>

<pre><code>&lt;div&gt;
  &lt;div class="alert alert-warning"&gt;
    &lt;div class="errorLogo"&gt;&lt;i class="icon-exclaim"&gt;&lt;/i&gt;&lt;/div&gt;
    &lt;div class="errorContent" data-ng-bind-html="errorMessage"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="buttonWrapper"&gt;
    &lt;button type="button" class="btn-primary pull-right"&gt;
      &lt;span res="close"&gt;&lt;/span&gt;
    &lt;/button&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>And this is how I open the dialog:</p>

<pre><code>function showErrorPopup() {
  ngDialog.open({
    template: 'errorPopup.html',
    scope: $scope,
    className: 'ngdialog-theme-default ngdialog-cart-theme',
    showClose: true,
    appendTo: 'div[ui-view]',
    closeByDocument: false
  });
}
</code></pre>

<p>So when I call showErrorPopup() I get a dialog displayed, however, I need to make this "close" button to actually dismiss/close the popup. As of now, this is just a plan button that doesn't do anything.</p>

<p>Is there something I can do a the template level (without changing my controller's code) to make the button work?</p>

<p>Maybe I should be using a default button instead of my own? If so, how?</p>

<p>PS: I notice thats clicking on the X button on the top right works, the popup is dismissed.</p>

<p>Thanks all!</p>