goinstant / goangular

AngularJS bindings for GoInstant. Build realtime, multi-user apps with AngularJS and GoInstant easily. https://developers.goinstant.com/v1/GoAngular/index.html
BSD 3-Clause "New" or "Revised" License
137 stars 30 forks source link

model#set merges new value into model #52

Closed colinmacdonald closed 10 years ago

colinmacdonald commented 10 years ago
$scope.results = $goKey('results').$sync();

$scope.results.$set({ a: 1}, {b: 2});

At this point all is well, $scope.results has a: 1 and b: 2.

$scope.results.$set({ a: 11 });

I would expect this to overwrite everything currently in that model, instead it merges the new value of a. Now the model has both a: 11 and b: 2 instead of just a: 11.

Upon refreshing the page, the model syncs and is correct again with just a: 11.

mattcreager commented 10 years ago

Joining.

mattcreager commented 10 years ago

I've fixed the issue but we'll need regression tests in the next release. Nice catch :)

mattcreager commented 10 years ago

Leaving.