janpantel / angular-sails

An angular module for using the sails socket.io api
MIT License
307 stars 56 forks source link

Fix(modelUpdater): Add ability to remove updater `on` #57

Closed TheSharpieOne closed 9 years ago

TheSharpieOne commented 9 years ago

You can now do something like:

var removeTaskUpdater = $sails.$modelUpdater('tasks', $scope.tasks);
$scope.$on('destroy', removeTaskUpdater);

or in 1 line

$scope.$on('destroy', $sails.$modelUpdater('tasks', $scope.tasks));

to remove the modelUpdater listener.