title: Automatically close ngDialog
body: <p>To automatically close a <code>ngDialog</code> after the successful login, I used the below approach.</p>
  
  <p>HTML template,</p>
  
  <pre><code>&lt;a href="" ng-click="signin()"&gt;Log In&lt;/a&gt;
  &lt;a href="" id="btnClose" ng-click="closeThisDialog()"   
  style="display:none;"&gt;Close&lt;/a&gt;
  </code></pre>
  
  <p>In the controller, the <code>signin</code> method has the following code to trigger the click event of close button,</p>
  
  <pre><code>$timeout(function () {
      var btnClose = document.getElementById('btnClose');
      angular.element(btnClose).triggerHandler('click');
  }, 0);
  </code></pre>
  
  <p>Is there any better approach to close the <code>ngDialog</code> automatically?</p>