title: angularjs: passing data to the ui-dialog directive
body: <p>I'm using the $dialog directive to show a dialog in my application. The dialog is opened from another directive :</p>
  
  <pre><code>angular.module('axa.directDebit.directives').directive("mandateHistoryDetail", ['$dialog', function($dialog) {
  return {
      restrict: 'E',
      template: '&lt;a class="btn btn-small" ng-click="openDialog()"&gt;Détail&lt;/a&gt;',
      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'
  }
  }]);
  </code></pre>
  
  <p>The problem I'm having, is that from the dialog's controller, I would like to access the calling directive's scope. In particular the 'model' property in the above code.</p>
  
  <p>I've tried using resolve, but the from the dialog controller I don't know how to get hold of data.</p>
  
  <p>Any idea what I should change ?</p>