$materialDialog
是Angular Material Design组件。
但是如何使用该组件?为什么它不返回 angular-ui bootstrap 之类的东西?如何检索承诺或结果或其他任何东西,只是关闭模式?这是一个简短的例子:
var test = $materialDialog({
templateUrl: '/Assets/app/azured/partials/dialog.html',
targetEvent: event,
resolve:{
item: function () {
return item;
}
},
appendTo: angular.element.find('dialog'),
controller: ['$scope', '$hideDialog', 'item', function ($scope, $hideDialog, item) {
$scope.name = item.Name;
$scope.cancel = function () {
$hideDialog();
}
$scope.ok = function () {
scope.name = '';
$hideDialog();
};
}]
});
test.then(function (x) {
console.log(x); //this prints destroyDialog function why?
});
我们从哪里知道用户按下了什么?我应该在 $materialDialog 中实现自定义逻辑吗?在那种情况下,我觉得很奇怪。github 237中的问题