$materialDialog
Angular Material Designコンポーネントです
。
しかし、そのコンポーネントをどのように使用するのでしょうか? angular-ui ブートストラップのようなものを返さないのはなぜですか? 約束や結果などを取得する方法は、モーダルを閉じるだけですか? 短い例を次に示します。
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の問題