title: Editing object with modal jhipster
body: <p>I used JHipster to create my project and it has been pretty smooth sailing of late. However, I ran into an issue with editing objects on my main.html. I am able to successfully edit the post when I'm on the posts.html page that the router points to, but I am unable to do it with the exact same code on my main.html. I am able to call the information from the postController on my main page, and it is displayed adequately. I am, however, unable to make my data appear inside the modal popup. I know the information is being received by the controller because my console.log($scope.post) returns the object that I want to edit. However, that information is not transmitted to my modal. Any help appreciated.</p>
  
  <p>Button that calls edit:</p>
  
  <pre><code>//inside postController and an ng-repeat of posts calling update function
  &lt;button class="btn btn-primary btn-xs" type="submit" ng-click="update(post.id)" class="btn"&gt;
      &lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt; Edit
  &lt;/button&gt;
  </code></pre>
  
  <p>Actual Modal Code:</p>
  
  <pre><code>&lt;div ng-controller="postController"&gt;
              &lt;textarea class="form-control" rows="3" placeholder="Status update here..." data-toggle="modal" data-target="#savePostModal" ng-click="clear()"&gt;&lt;/textarea&gt;
              &lt;div class="modal fade" id="savePostModal" tabindex="-1" role="dialog" aria-labelledby="myPostLabel" aria-hidden="true"&gt;
                  &lt;div class="modal-dialog"&gt;
                      &lt;div class="modal-content"&gt;
                          &lt;form name="form" role="form" novalidate class="ng-scope ng-invalid ng-invalid-required ng-dirty ng-valid-minlength" ng-submit="create()"&gt;
  
                              &lt;div class="modal-header"&gt;
                                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="clear()"&gt;&amp;times;&lt;/button&gt;
                                  &lt;h4 class="modal-title" id="myPostLabel"&gt;Create or edit a Post&lt;/h4&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-body"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;label&gt;ID&lt;/label&gt;
                                      &lt;input type="text" class="form-control" name="id" ng-model="post.id" readonly&gt;
                                  &lt;/div&gt;
  
                                  &lt;div class="form-group"&gt;
                                      &lt;label&gt;Title&lt;/label&gt;
                                      &lt;input type="text" class="form-control" name="test" placeholder="Title your post..." ng-model="post.name" ng-minlength=1 required&gt;
                                  &lt;/div&gt;
  
                                  &lt;div class="form-group"&gt;
                                      &lt;label&gt;Author&lt;/label&gt;
                                      &lt;input type="text" class="form-control" name="test" placeholder="Temporary Field..." ng-model="post.author" ng-minlength=1 required&gt;
                                  &lt;/div&gt;
  
                                  &lt;div class="form-group"&gt;
                                      &lt;label&gt;Text&lt;/label&gt;
                                      &lt;textarea rows="8" placeholder="Status update here..." class="form-control" type="text" name="test" ng-model="post.text" ng-minlength=1 required&gt;&lt;/textarea&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-footer"&gt;
                                  &lt;button type="button" class="btn btn-default" data-dismiss="modal" ng-click="clear()"&gt;
                                      &lt;span class="glyphicon glyphicon-ban-circle"&gt;&lt;/span&gt; Cancel
                                  &lt;/button&gt;
                                  &lt;button type="submit" ng-disabled="form.$invalid" class="btn btn-primary"&gt;
                                      &lt;span class="glyphicon glyphicon-save"&gt;&lt;/span&gt; Save
                                  &lt;/button&gt;
                              &lt;/div&gt;
                          &lt;/form&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>Update function</p>
  
  <pre><code>$scope.update = function (id) {
          $scope.post = Post.get({id: id});
          $('#savePostModal').modal('show');
      };
  </code></pre>
  
  <p>I know it's successfully calling this get function, but the data from the $scope.post isn't being used.</p>