$dialog ディレクティブを使用して、アプリケーションでダイアログを表示しています。ダイアログは別のディレクティブから開かれます:
angular.module('axa.directDebit.directives').directive("mandateHistoryDetail", ['$dialog', function($dialog) {
return {
restrict: 'E',
template: '<a class="btn btn-small" ng-click="openDialog()">Détail</a>',
scope: {
model: '='
},
link: function (scope, element, attrs) {
scope.openDialog = function(){
var d = $dialog.dialog({
backdrop: true,
keyboard: true,
backdropClick: true,
dialogFade: true,
templateUrl: 'app/directDebit/views/mandates.detail.history.detail.html',
controller: 'mandates.detail.history.detail.ctrl',
resolve: {
data: function () {
return scope.model;
}
}
});
d.open();
}
},
controller: 'mandates.detail.history.detail.ctrl'
}
}]);
私が抱えている問題は、ダイアログのコントローラーから、呼び出し元のディレクティブのスコープにアクセスしたいということです。特に、上記のコードの「モデル」プロパティ。
解決を使用してみましたが、ダイアログ コントローラーからデータを取得する方法がわかりません。
何を変更すればよいですか?