I would just convert the object into an array when I needed it:
var a = {"321":true,"322":true};
var b = [];
var i = 0;
for(x in a){
b[i++] = parseInt(x,10);
}
// b === [321,322]
Otherwise, you could use the ngChange directive(NOTE: I haven't tested this code):
html:
<input type="checkbox" ng-model="versionValues[system_history.version]
ng-change="update(system_history.version)"
">
js:
$rootScope.versionValues = {};
$rootScope.versionValuesArray = [];
$rootScope.update(version){
if($rootScope.versionValues[version]){
// add version to $rootScope.versionValuesArray
}else{
// remove version from $rootScope.versionValuesArray
}
}
But the problem with that is that it takes linear time to insert and remove from an array, which is of the same magnitude as the time to convert the entire object into an array.