(js) Intercept and show HTTP errors in md-toast

This commit is contained in:
Francis Lachapelle
2015-12-08 16:45:24 -05:00
parent 24520418f9
commit db96b2830e
3 changed files with 43 additions and 19 deletions

View File

@@ -117,20 +117,6 @@
vm.message.$send().then(function(data) {
$mdDialog.hide();
}, function(data) {
$mdToast.show({
controller: 'SendMessageToastController',
template: [
'<md-toast>',
' <span flex>' + l(data.message) + '</span>',
' <md-button class="md-icon-button md-primary" ng-click="closeToast()">',
' <md-icon>close</md-icon>',
' </md-button>',
'</md-toast>'
].join(''),
hideDelay: 2000,
position: 'top right'
});
});
}