I am using Angular Material and I have created a simple preset dialog using $mdDialogProvide:
angular.module('starterApp').config([
'$mdDialogProvider',
function ($mdDialogProvider) {
$mdDialogProvider.addPreset('warning', {
options: function () {
return {
template:
'<md-dialog>' +
'{{dialog.warning}}' +
'</md-dialog>',
controllerAs: 'dialog',
theme: 'warning'
};
}
});
}
]);
And I want to pass a warning message on invoking it. I tried to pass a message for example like this:
$mdDialog.show(
$mdDialog.warning({
locals: {
warning: 'Warning message'
}
})
);
But is does not work.
Actually I checked a lot of solutions, but none of them is working. There is no example like this in documentation neither.
Is it possible to pass some date to preset dialog?