My Goal:
I have a list that i need to iterate. Each item in this list has a list of its own (nested). For each of these nested list items I need to have a set of two checkboxes for the user to designate their choice. I need to sync these checkbox choices back into the scope variable that should be synced with firebase. Below is a simplified version of my code.
Example
My Controller
fbutil.syncObject("items").$bindTo($scope, "items");
My View
<div ng-repeat="item in items">
{{item.title}}
<div ng-repeat="option in item.options">
{{option.title}}
<input type="checkbox" id="{{item.title}}+{{option.title}}+pos" ng-model="option.results" ng-true-value="'positive'" ng-false-value="''"><label for="{{item.title}}+{{option.title}}+pos"></label>
<input type="checkbox" id="{{item.title}}+{{option.title}}+neg" ng-model="option.results" ng-true-value="'negative'" ng-false-value="''"><label for="{{item.title}}+{{option.title}}+neg"></label>
</div>
</div>
My Problem
I just updated from angularfire 0.7.1 to and 0.8 and started getting this error when iterating through a nested ng-repeat in my view. it worked fine before, but now i get the error when i select a checkbox, stating:
Firebase.set failed: First argument contains an invalid key ($$hashKey) in property '0.testCustom.0'. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"
I understand (i think) this has something to do with Angularfire either getting the data as an array or an object. I understand that this is because angular/firebase attaches these keys (like $id or $$hashKey) to objects and using angular.copy() to clean these up does not work.
Here is a similar question but @kato's only reponse is not to fetch the parent but go directly to the child collection. I can't think of a way to do this in my situation... @kato's post in the comments:
Don't fetch the parent (account/) as an object and then try and use it's child as a collection. The embedded array is not going to work since angular attaches invalid properties to it. [...] AngularFire is a bindings library--it binds objects and collections--not a local copy of your Firebase data tree. Just get the collection directly
/////////Edit
In response to @jacobawenger's comment, how would i save these changes back to firebase if i use $asArray() instead of $asObject() to pull in my collection?
here is a plunker of what I am trying to do:
Plunker example
I have a 'saveChange()' function that i do not know how to implement