Created
October 17, 2016 09:59
-
-
Save davros85/9dac900597aef9034ffdec3cf72af4fc to your computer and use it in GitHub Desktop.
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
import * as ko from 'knockout'; | |
// ...imports omitted... | |
import {EventBus} from './EventBus'; | |
export default class CoffeeRoundViewModel { | |
// ...other vars omitted... | |
private eventBus = EventBus.getInstance(); | |
constructor() { | |
var self = this; | |
self.eventBus.myProp.subscribe( | |
function(){ | |
// this is called whenever the value changes | |
console.log('Subscribe: ' + self.eventBus.myProp()); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment