title: Get selected ion-checkbox from json array angularjs
body: <p>I have the following array:</p>
  
  <pre><code>$scope.profile.preferencias = [7,5,3,8,4];
  </code></pre>
  
  <p><strong>EDIT</strong>
  My Category array looks like this:</p>
  
  <pre><code>[
    {
      "id": 2,
      "descricao": "Entomologia",
      "dataCriacao": "0001-01-01T00:00:00",
      "isActive": true,
      "isFixed": true
    },
    {
      "id": 3,
      "descricao": "Fisiologia",
      "dataCriacao": "0001-01-01T00:00:00",
      "isActive": true,
      "isFixed": true
    }
  ]
  </code></pre>
  
  <p>My ion-checkbox looks like this:</p>
  
  <pre><code>&lt;ion-checkbox ng-repeat="category in categories | toArray | orderBy:'descricao'" name="group" ng-model="profile.preferencias[category.id]"&gt;{{category.descricao}}&lt;/ion-checkbox&gt;
  </code></pre>
  
  <p>The output selected is:</p>
  
  <pre><code>{
     "7": true,
     "5": false,
     "3": true
  }
  </code></pre>
  
  <p>How can i sent only the number to my json, so it will save like the $scope above, and when the page is reloaded, the checkboxes comes back checked?</p>
  
  <p>Thanks!</p>