Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable backdrop with Angular Material

I am working an a project and I make use of a lot of md dialogs. And i was wondering how to disable the backdrop. I have look with inspect element (Chrome) but can't seem to find any styling to disable ....

Anyone have an idea ?

like image 610
GY22 Avatar asked Feb 09 '23 11:02

GY22


1 Answers

The docs for $mdDialog say:

hasBackdrop - {boolean=}: Whether there should be an opaque backdrop behind the dialog. Default true.

var confirm = $mdDialog.confirm()
  .parent(angular.element(document.body))
  .title('Would you like to delete your debt?')
  .content('All of the banks have agreed to forgive you your debts.')
  .ariaLabel('Lucky day')
  .ok('Please do it!')
  .cancel('Sounds like a scam')
  .targetEvent(ev)
  .hasBackdrop(false);

Working codepen at: http://codepen.io/anon/pen/dogrXG

Click the button and you get a dialog with no backdrop.

like image 166
shashanka n Avatar answered Feb 13 '23 06:02

shashanka n