Return 从 ngDialog 返回的值

Return value back from ngDialog

我正在使用 ngDialog。出于某种原因,当我单击“关闭”时,closePromise 数据参数没有 return "Vacancy" 对象,而是 returned 值未定义。

请告知如何将值从我的对话框返回到我的调用控制器。下面是我的代码:

<script type="text/ng-template" id="firstDialogId">
<div class="ngdialog-message">

    <h3>Pick a School</h3>
    <div class="form-group">
        <md-input-container class="md-block" >
            <md-select ng-model="Vacancy" placeholder="Select a Vacancy" id="Md-select2" name="vacancy2" >
                <md-option ng-value="vac" ng-repeat="vac in vacancylist" >{{vac.JobTitle}}</md-option>
            </md-select>
        </md-input-container>
    </div>
</div>

<div class="ngdialog-buttons">
    <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="closeThisDialog(Vacancy)">Ok</button>
</div>

$scope.clickToOpen = function () {
var dialog =  ngDialog.open({
        template: 'firstDialogId',
        className: 'ngdialog-theme-default',
        showClose: false,
        closeByEscape: false,
        width: '40%',
        closeByDocument: false,
        //data: { parentDialogModel: $scope.vacancylist }
    scope: $scope
}).closePromise.then(function (data) {
    if (data.value && data.value != '$document') {
        notification.show('success', 'Password was updated.');
    }
    else {
        notification.show('info', 'Password was not updated.');
    }

    return true;
});

我缺少以下值属性:

   <button type="button" class="ngdialog-button ngdialog-button-primary" value="OK" ng-click="closeThisDialog(Vacancy)">Ok</button>