m-e-conroy / angular-dialog-service

A complete AngularJS service with controllers and templates for generating application modals and dialogs for use with Angular-UI-Bootstrap and Twitter Bootstrap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add buttons to error dialog?

smartm0use opened this issue · comments

Hello, i created the following method:

    function throwErrorDialogFn(message) {
      var dialogTitle = 'Error';
      var dialogMsg = '';

      if (message === 'no-data') {
        dialogMsg = 'No documents';
      } else if (message === 'error') {
        dialogMsg = 'Loading error';
      }
      var dialogOptions = {
        animation: true,
        backdrop: 'static',
        keyboard: false,
        size: 'sm'
      };

      var dialog = dialogs.error(dialogTitle, dialogMsg, dialogOptions);
      dialog.result.then(function(btn) {
        console.log('button1');
      }, function(btn) {
        console.log('button2');
      });
    }

But it displays only the first button. How to enable button 2 or how to add more buttons?