I am using Angular Material, and I created a simple settings 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 send a warning message about his call. I tried to pass a message, for example, as follows:
$mdDialog.show(
$mdDialog.warning({
locals: {
warning: 'Warning message'
}
})
);
But that does not work.
In fact, I checked a lot of solutions, but none of them work. The documentation also does not have such an example.
Is it possible to pass some date to a predefined dialog?
source
share