title: How to share scope between controller and $mdDialog?
body: <p>How can I share scope between controller and  $mdDialog (Angular Material)?
  I'm using "Controller As" syntax, and I need to use functions of my controller into  $mdDialog cause when it close, I will need some data.
  In this code, I need to call "myFunction" in $mdDialog. 
  occurs that if I have an object (self.obj) and I need it into 'myFunction', when $mdDialog calls 'myFunction' the object doesn't exists into the scope.</p>
  
  <pre><code>angular.module('myApp')
            .controller('myController', myController);
  
  myController.$inject = ['$mdDialog'];
  
  function myController($mdDialog) {
  
  var self = this;
  self.obj = {'firstName:'hello','lastName':'world'}
  
  
  self.myFunction = function () {console.log(JSON.stringfy(self.obj))};
  
  self.showDialog = function (){
  
      $mdDialog.show({
          controller: function ctrl() {},
          controllerAs: 'ctrl',
          templateUrl: 'views/modal_templates/dialog01.template.html',
          parent: angular.element(document.body),
          targetEvent: ev,
          clickOutsideToClose: true
      })
  }
  
  };
  </code></pre>