Skript
if (true) {
if(!confirm("Are you sure ?"))
{
event.preventDefault();
}
}
Wie kann ich scharfkantiges Material Dialogfeld aufrufen, anstatt Standard-JavaScript-Bestätigung? Etwas wie
function(event) {
var confirm = $mdDialog.confirm()
.title('Are you sure ?')
.targetEvent(event)
.ok('ok')
.cancel('cancel');
$mdDialog.show(!confirm).then(function() {
event.preventDefault();
});
};
nicht-'confirm() 'Dialoge sind fast immer async, einen Rückruf anstelle eines Rückgabewert benötigen. – dandavis