Open colinmacdonald opened 10 years ago
This could be quite useful if using with $save
on a specific child node (when we have it) instead of having to $sync
first. Thinking something like:
$scope.todos = $goKey('todos').$sync();
$scope.editTodo = function(id, desc) {
var todo = $scope.todos.$key(id);
todo.desc = desc;
todo.complete = !todo.complete;
todo.$save();
};
to prevent children from being sync'd automatically we could have an option on either the parent sync
var todos = $goKey('todos').$sync({capture: true}); // default capture === false
or when creating a new model on a child
var todo = todos.$key('id-1231y182u12b-000', { sync: true/false });
We already have this data sync'd on the parent, should make it easier to work with child key models.