title: manipulating JSON object in angular
body: <p>I am using angular and I am using $http.get to get a JSON response back and I set it equal to <code>$scope.myObjects</code> .</p>
  
  <p>When I use <code>ng-repeat="object in myObjects"</code> in the html, it works.</p>
  
  <p>I wanted to know, is there a way to manipulate these objects? I want to create a property called <code>myBoolean</code> and for each object in <code>myObject</code> set <code>myBoolean</code> to <code>true</code>.</p>
  
  <p>When trying to manipulate this object in the controller by doing something like:
  <code>$scope.myObjects.something</code> I get <code>myObjects is undefined</code></p>
  
  <p>when I try to view the JSON response in the browser all I see is [object Object]. Is there a tool to view the JSON response?</p>
  
  <p>EDIT:
  here is my html</p>
  
  <pre><code>&lt;div class="comment" ng-hide="loading" ng-repeat="comment in comments"&gt;
      &lt;h3&gt;Comment &lt;% comment.id %&gt; &lt;small&gt;by &lt;% comment.author %&gt;&lt;/h3&gt;
      &lt;p&gt;&lt;% comment.text %&gt;&lt;/p&gt;
      &lt;div class="col-sm-6"&gt;
          &lt;p&gt;&lt;a href="#" ng-click="deleteComment(comment.id)" class="text-muted"&gt;Delete&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>here is my controller</p>
  
  <pre><code>angular.module('mainCtrl', [])
  
  
  .controller('mainController', function($scope, $http, Comment) {
  
  $scope.commentData = {};
  
  
  $scope.loading = true;
  
  
  Comment.get()
      .success(function(data) {
          $scope.comments = data;
          $scope.loading = false;
      });
  });
  </code></pre>
  
  <p>and my service </p>
  
  <pre><code>angular.module('commentService', [])
  
  .factory('Comment', function($http) {
  
  return {
      // get all the comments
      get : function() {
          return $http.get('/api/comments');
      },
  });
  </code></pre>