Skip to content

Instantly share code, notes, and snippets.

View BioPhoton's full-sized avatar
🙃
implementing and fixing bugs

Michael Hladky BioPhoton

🙃
implementing and fixing bugs
View GitHub Profile
@BioPhoton
BioPhoton / myChannel.js
Last active August 29, 2015 14:24
AngularJS Event-Channel (slides (here) [http://slides.com/michael_hladky/event-channel#/] )
.config('myEvents', function() {
valueChanged : 'valueChanged'
});
.service('myChannel', function($rootScope, myEvents) {
var publishValueChanged = function (newVlaue) {
var args = {value: newVlaue};
$rootScope.$emit(myEvents.valueChanged, args);
};