title: how to get the object from ng-repeat checkbox values in Angular JS
body: <p>I'm encountering a problem and I will appreciate someone can help.</p>
  
  <p>Right now I'm showing several checkboxes in my form which are grabbing from my firebase database. And in my controller I'm trying to use ng-submit to store whole data of form.
  My checkbox JSON format should look like this.</p>
  
  <pre><code>{
      "apple" : true,
      "spotify" : true 
  }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/phsq3.jpg" rel="nofollow">The checkbox image here</a></p>
  
  <p>okay the following is my code from HTML and Javascript</p>
  
  <pre><code>&lt;label class="checkbox-inline" ng-repeat="hashtag in hashtags" for="{{hashtag}}"&gt;
    &lt;input type="checkbox" name="{{hashtag.$value}}" id="{{hashtag.$value}}" value="{{hashtag.$value}}" ng-model="hashtag.SELECTED" ng-true-value="true" ng-false-value="false"&gt; 
      {{hashtag.$value | capitalize}}
  &lt;/label&gt;
  </code></pre>
  
  <p>My Javascript here</p>
  
  <pre><code>form.$add({
      description: $scope.inputDescription,
      hashtags: {
          *I don't know how to put checkbox's result here.*
      },
      time: Firebase.ServerValue.TIMESTAMP,
      title: $scope.inputTitle,
      url: $scope.inputUrl
  })
  </code></pre>
  
  <p>Anyone can help, please? Thank you so much.</p>
  
  <p><strong>Update</strong>
  Thanks for the reply. I really appreciate those! However, I found out that I forgot to mention something and I tried the answers from the reply and they didn't work. The picture below will explain my problem.
  <a href="http://i.stack.imgur.com/FAyRU.jpg" rel="nofollow">enter image description here</a>
  Thank you so much!</p>
  
  <p><strong>Finally solution</strong> in case people are curious about the answer I just figured out. The following is my solution. Thank you guys! I love stackoverflow!</p>
  
  <pre><code>function checkbox(hashtags) {
      var arr = {};
      for(var hashtag in hashtags) {
          if(hashtags[hashtag].SELECTED === true){
              arr[hashtags[hashtag].$value] = true;
          }
      }
      return arr;
  }
  </code></pre>