将信号从$ mdDialog传递到父控制器

时间:2019-05-30 10:24:13

标签: angularjs

我试图在$ mdDialog上按下按钮时向父控制器发送信号。我不想使用广播。我怎样才能做到这一点?使用AngularJS 1.7

我尝试过:

$mdDialog.show(confirm).then(function () {
    testService.startTest()
        .then(function (response) {
            console.log(passData);
    });
});

self.showTestDialog = function (event) {
    $mdDialog.show({
        controller: 'dialog.test.controller',
        controllerAs: '$ctrl',
        templateUrl: '/testr.template.html',
        parent: angular.element(document.body),
        targetEvent: event,
        clickOutsideToClose: true
    });
};

0 个答案:

没有答案