(js) Fix sg-avatar-image with md-virtual-repeat

This commit is contained in:
Francis Lachapelle
2016-01-14 14:45:50 -05:00
parent 936f6cb073
commit 491f8b4f2a
6 changed files with 81 additions and 57 deletions
@@ -66,23 +66,26 @@
function onHttpError(event, response) {
var message;
if (response.data.message)
if (response.data && response.data.message)
message = response.data.message;
else
else if (response.status)
message = response.statusText;
$mdToast.show({
template: [
'<md-toast>',
' <div class="md-toast-content">',
' <md-icon class="md-warn md-hue-1">error_outline</md-icon>',
' <span flex>' + l(message) + '</span>',
' </div>',
'</md-toast>'
].join(''),
hideDelay: 5000,
position: 'top right'
});
if (message)
$mdToast.show({
template: [
'<md-toast>',
' <div class="md-toast-content">',
' <md-icon class="md-warn md-hue-1">error_outline</md-icon>',
' <span flex>' + l(message) + '</span>',
' </div>',
'</md-toast>'
].join(''),
hideDelay: 5000,
position: 'top right'
});
else
console.debug('untrap error');
}
// Listen to HTTP errors broadcasted from HTTP interceptor