BindTo
steveharan opened this issue · comments
Why is that the bound to variable:
a) gets updated from FB - tick
b) gets updated back to FB when value updated in the code - tick
c) doesn't get updated back to FB after (b)???
var ref = firebase.database().ref().child($rootScope.ownerId);
var syncObject = $firebaseObject(ref);
syncObject.$bindTo($scope, "data");
$scope.$watch('data.$value', function () {
// works whenever FB value is updated to 'True'
if ($scope.data.$value == "True") {
// works once. First time, FB value is updated. When FB is updated back to 'True', we do get here, and this changes - but doesn't update FB
$scope.data.$value = "False";
alert('You have a new message ');
}
}, true);
Closing as invalid since this does not follow the issue template. Please open up a new issue with the entire issue template filled out.