$ mdDialog confirm reorder cancel-ok to ok-cancel

In our web application, I use Angular -Materials $ mdDialog with a confirmation object. Can I change the order of buttons from cancel-ok to ok-cancel? And set the initial focus to the cancel button? Maybe through CSS or a template?

The code is as follows:

var confirm = this.$mdDialog.confirm()
  .parent(angular.element(document.body))
  .title('Löschen')
  .content('Möchten Sie wirklich löschen?')
  .ariaLabel('Löschen')
  .ok('Ja')
  .cancel('Nein')
  .targetEvent(event);

this.$mdDialog.show(confirm)
  .then(() => {
     // do something
  });

enter image description here

+4
source share
1 answer

This might work:

md-dialog md-dialog-actions {
    display: block;
}

md-dialog md-dialog-actions button {
    float: right;
}
+6
source

Source: https://habr.com/ru/post/1629386/


All Articles