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
One more step to rlay3's answer.
Angular Material at 0.7.1 added warning to unregistered themes. https://github.com/angular/material/blob/master/CHANGELOG.md#071--2015-01-30
If theme is not registered, every time the toast shows up, you will be getting a warning message in console like, for example:
attempted to use unregistered theme 'custom-toast'
angular.js:12416 Attempted to use unregistered theme 'custom-toast'.
Register it with $mdThemingProvider.theme().
To get rid of the warning, you will need to configure the theme 'custom-toast' in your angular app:
angular.module('myApp', ['ngMaterial'])
.config(function($mdThemingProvider) {
$mdThemingProvider.theme('custom-toast')
});
and use it like:
$mdToast.simple().content("some test").theme("custom-toast");
references: https://material.angularjs.org/latest/#/Theming/04_multiple_themes