$mdDialog.hide cannot pass more than 1 parameter to promise
$mdDialog.show({
controller: editNewsDlgController,
templateUrl: '/admin/partials/dialogs/editNewsDlg.html',
locals: {
isNew: false,
news: $scope.newsList[index]
},
clickOutsideToClose: true
})
.then(function (result, update, newPhoto) {
console.log(result); // true
console.log(update); // undefined
console.log(newPhoto); // undefined
console.log('only photo hide'); // hit, printed
$mdDialog.hide(true, null, true);
You could temporarily solve this by creating an object with all three of those params values and passing them through:
result:{
result: result,
update: update,
newPhoto: newPhoto,
}
$mdDialog.hide(result);
.then(function(result){
console.log(result.result, result.update, result.newPhoto)
});
Yeah I temporarily solved it already, thx On Dec 22, 2015 3:30 AM, "EsunaProxy" [email protected] wrote:
You could temporarily solve this by creating an object with all three of those params values and passing them through:
result:{ result: result, update: update, newPhoto: newPhoto, }
$mdDialog.hide(result);
.then(function(result){ console.log(result.result, result.update, result.newPhoto) });
— Reply to this email directly or view it on GitHub https://github.com/angular/material/issues/6413#issuecomment-166383151.
This issue is closed as part of our deprecation effort. For details, see our post Spring Cleaning 2016.