While using $mdToast.simple().content(\"some test\")
it is showing the toast with black color. how can I change that color to red, yellow and so, depends on the typ
Just to give another option, $mdToast
allows to define toast presets that you can easily instantiate in this way, though i'm struggling to understand how to change the text content, any idea?
$mdToast.show(
$mdToast.error()
);
The presets are defined as explained on https://material.angularjs.org/latest/api/service/$mdToast :
$mdToastProvider.addPreset('error', {
options: function() {
return {
template:
'' +
'' +
'' +
' ',
position: 'top left',
hideDelay: 2000,
toastClass: 'toast-error',
controllerAs: 'toast',
bindToController: true
};
}
});