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

feat($goSync): Sync local object w. GoInstant key #27

Closed mattcreager closed 10 years ago

mattcreager commented 10 years ago

The $goKey service has been introduced, it takes a single argument, a key. $goKey returns a model, the standard key methods are exposed, prefixed with a '$'. This model will be kept current with the key.

Note: Changes to the object are not persisted back to the key.

For example, to return a collection of todos:

$scope.todos = $goKey(lobby.key('todos'));
$scope.todos.$sync();

To add a new todo:

$scope.todos.$add({
  description: 'a fresh todo',
  complete: false
});

Each of the methods with the exception of $sync, returns a promise.

Additional minor changes:

Also added grunt-contrib-watch, it adds grunt watch, which:

Closes #28, #23, #31

mattcreager commented 10 years ago

Verbal LGTM received via. @ianlivingstone