Skip to content

Instantly share code, notes, and snippets.

@kapusta
Created May 8, 2015 20:15
Show Gist options
  • Save kapusta/d4ee0d25a9a81f7dbdb6 to your computer and use it in GitHub Desktop.
Save kapusta/d4ee0d25a9a81f7dbdb6 to your computer and use it in GitHub Desktop.
angular-local-storage broadcasts events when it does stuff, listen for those events thusly...
// https://github.com/grevory/angular-local-storage#setnotify
$scope.$on("LocalStorageModule.notification.setitem", function (key, newVal, type) {
$log.log("LocalStorageModule.notification.setitem", key, newVal, type);
});
$scope.$on("LocalStorageModule.notification.removeitem", function (key, type) {
$log.log("LocalStorageModule.notification.removeitem", key, type);
});
$scope.$on("LocalStorageModule.notification.warning", function (warning) {
$log.warn("LocalStorageModule.notification.warning", warning);
});
$rootScope.$on("LocalStorageModule.notification.error", function (errorMessage) {
$log.error("LocalStorageModule.notification.error", errorMessage);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment