title: ui-router: open modal and pass parent scope parameters to it
body: <p>I am using this FAQ entry to open a modal dialog in a child state of a certain state: <a href="https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-open-a-dialogmodal-at-a-certain-state">https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-open-a-dialogmodal-at-a-certain-state</a></p>
  
  <p>My code is below. When I open a modal dialog, I need to get access to the properties of the parent state's scope. Is this possible?</p>
  
  <p>plnkr: <a href="http://plnkr.co/edit/knY87n">http://plnkr.co/edit/knY87n</a></p>
  
  <pre><code>         .state('edit', {
               url: '/{id:[0-9a-f]+}',
               views: {
                   '@': {
                       templateUrl: 'views/edit.html',
                       controller: 'editContr'
                   }
               }
           })
           .state('edit.item', {
               url: "/item/new",
               onEnter: function($stateParams, $state, $modal) {
                   $modal.open({
                       controller: 'itemEditContr',
                       templateUrl: 'views/edit-item.html',
                   }).result.then(function (item) {
                       //
                       // here I need to insert item into the items
                       // seen by my parent state. how?
                       //
                       $state.go('^');
                   }, function () {
                       $state.go('^');
                   });
               }
           });
  
  
  function editContr($scope) {
      $scope.items = [{name: 'a'}, {name: 'b'}, {name: 'c'}];
  }
  
  function itemEditContr($scope, $modalInstance) {
       $scope.submit = function () {
           $modalInstance.close($scope.item);
       };
       $scope.cancel = function () {
           $modalInstance.dismiss('cancel');
       };
       $scope.item = {name: 'test'};
  }
  </code></pre>