title: returning uibmodal result to parent controller
body: <p>so here is my modal JS:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function modalInstance() {
          var ctrlr = function($scope,$uibModalInstance,inName) {
              var init = function() {
                  $scope.modalTmpStep = {
                      pos: 0,
                      body: ''
                  };
                  $scope.cancelStep = cancelStep;
                  $scope.submitStep = saveStep;
              };
  
              function cancelStep() {
                  console.log('closing');
                  $uibModalInstance.dismiss('dismissed');
              }
              function saveStep() {
                  var submitVar = JSON.stringify($scope.modalTmpStep)
                  console.log('submitting')
                  $uibModalInstance.close(submitVar);
              }
  
              init()
          };
  
          var modalInstance = $uibModal.open({
              animation: true,
              templateUrl: 'main/add/stepModal/addModal.html',
              controller: ctrlr,
              size: 'lg',
              backdrop: 'static'
          });
  
          modalInstance.result.then(function() {
              console.log();
          })
  
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The end goal of this piece of code is to print the object "submitVar" somewhere on the parent page, the object could be a string or a JSON. All the variables in questions are being chaned using ng-model in the HTML. I don't know how to pass this value back to the parent controller and need some help.</p>
  
  <p>Currently the line console.log('submitting') runs, but i don't know where the submitVar result is placed. I'm planning to use this as as an editing window, so an object is passed in, then edited and passed back, changing the current value.</p>
  
  <p>I'm using: <a href="https://angular-ui.github.io/bootstrap/" rel="noreferrer">https://angular-ui.github.io/bootstrap/</a> as a reference and cant find any other documentation on this.</p>