title: Angular modal is not updating $scope in result
body: <p>I'm trying to implement a modal window in Angular to prompt a user for an input, I've used almost the same code in a previous app and it worked, I really don't know what is going on here...</p>
  
  <p>Here is the controller that opens the modal (in Coffee Script):</p>
  
  <pre><code>.controller('addStreamModal', [
      '$scope', '$modal', '$log', '$http', '$rootScope'
      ($scope, $modal, $log, $http, $rootScope) -&gt;
          $scope.open = -&gt;
              modalInstance = $modal.open(
                  templateUrl: "addStream.html"
                  controller: 'addStreamModalInstance'
                  resolve:
                      public_key: -&gt;
                          "placeholder"
              )
              modalInstance.result.then ((result) -&gt;
                  return
              ), -&gt;
                  $log.info "Modal dismissed at: " + new Date()
                  return
              return
          return
  ])
  </code></pre>
  
  <p>Now the modal instance controller:</p>
  
  <pre><code>.controller('addStreamModalInstance', [
      '$scope', '$modalInstance', '$http', 'public_key'
      ($scope, $modalInstance, $http, public_key) -&gt;
          console.log(public_key)
          $scope.public_key = public_key
          $scope.ok = -&gt;
              console.log($scope.public_key)
              $modalInstance.close $scope
              return
          $scope.cancel = -&gt;
              $modalInstance.dismiss "cancel"
              return
          return
  ])
  </code></pre>
  
  <p>And the HTML:</p>
  
  <pre><code>&lt;div class="modal-header"&gt;
      &lt;h4&gt;Please enter the private key for verification {{public_key}}&lt;/h4&gt;
  &lt;/div&gt;
  &lt;div class="modal-body"&gt;
      &lt;div class="form-group"&gt;
          &lt;input type="text" class="form-control" id="exampleInputEmail1" ng-model="public_key"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="modal-footer"&gt;
      &lt;button class="btn btn-primary" ng-click="ok()"&gt;OK&lt;/button&gt;
      &lt;button class="btn btn-warning" ng-click="cancel()"&gt;Cancel&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So I click a button and the Modal opens with "placeholder" in the text box, I can also see this test bound to the modal title.  As I endit text in the box, the title continues to update as expected due to binding, however when I click ok, it seems like the $scope.public_key reverts back to "placeholder".  Trying to figure out why.</p>