Last active
January 26, 2016 13:40
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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