Skip to content

Instantly share code, notes, and snippets.

@manekinekko
Last active January 26, 2016 13:40
Show Gist options
  • Save manekinekko/187e72db6217f4f19b33 to your computer and use it in GitHub Desktop.
Save manekinekko/187e72db6217f4f19b33 to your computer and use it in GitHub Desktop.
This is an implementation of Service Observer Pattern in AngularJS (1.x) using ES6.
export var ObserverService = (function(){
// MUST be an object
var data = {};
return class ObserverService {
constructor () {}
api() {
data = {
newValue: new Date()
}
}
getData() {
return data;
}
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment