The real problem is how you use the method hide, it can, if desired, receive a promise at the input that will be resolved.
So, your code to work should be:
app.controller('testCtrl', function ($rootScope, $scope, $mdToast)
{
$scope.showHideToast = function () {
var myToast = $mdToast.show({
template : '<md-toast>test</md-toast>',
hideDelay : 0,
position : 'bottom right'
});
$mdToast.hide(myToast);
};
}
A method call hidethus closes a previously defined toast, even if it was defined using hideDelay: 0.
source
share