Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ObjectA.prototype = new MVCObject();
- var object_a = new ObjectA();
- ObjectA.prototype.foo_changed = function()
- {
- console.log('ObjectA foo changed, it is now: ' + this.get('foo'));
- };
- // Not working Hook
- object_a.changed('foo', () => {
- console.log('===> index.js ===> Need to be Fired');
- })
- $(function(){
- $('#btn-panel').click(function(){
- object_a.set('foo', 'I am cool');
- });
- });
- object_a.on('foo_changed', function() {
- console.log('===> index.js ===> First Listener');
- })
- object_a.on('foo_changed', function() {
- console.log('===> index.js ===> Second Listener');
- })
Add Comment
Please, Sign In to add comment