title: In angularjs ngDialog.openConfirm dialog appears after whole function execution
body: <p>In angularjs I want to show confirm dialog on delete operation my code is below :</p>
  
  <pre><code>function deleteOperation(){
      var result;        
               ngDialog.openConfirm({
                      template:
                          '&lt;p&gt;Are you sure you want to delete selected conversation(s) ?&lt;/p&gt;' +
                          '&lt;div&gt;' +
                            '&lt;button type="button" class="btn btn-default" ng-click="closeThisDialog(0)"&gt;No&amp;nbsp;' +
                            '&lt;button type="button" class="btn btn-primary" ng-click="confirm(1)"&gt;Yes' +
                          '&lt;/button&gt;&lt;/div&gt;',
                      plain: true,
                      className: 'ngdialog-theme-default'
                  }).then(function (value) {
                      result=true;
                  }, function (value) {
                      result=false;
                  });
  
              if (result == true) {
                  // perform delete operation
   }
  }
  </code></pre>
  
  <p>But dialog is displayed after whole function execution, so in if condition result variable get undefined value</p>