I've had that thought a few times and then I was forced to remember that I shouldn't be doing that because it breaks the MVVM pattern and makes it impossible to unit test properly. To do something like that you can add a property to your viewmodel and implement a set property function which fires the event on the view. It feels a little hacky because it is... But it works :). Hope that helps!
Ryan
Is it possible from a model to fire an event that is observed on the view side ... o in other words is it possible to listen on the view to events fired in the model ... thanks in advance- Mauro
--
You received this message because you are subscribed to the Google Groups "GluJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glujs+un...@googlegroups.com.
To post to this group, send email to gl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glujs/10665b9e-e5cb-44b2-a33b-5e26327e29f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/glujs/CAMT%2BkPv9t14hJtcH0p64hpwA_NMMB8eMPjxdPY2Tw0WGVHHBOw%40mail.gmail.com.
//..
listeners:{
glubind:function(view){
view._vm.on('closepopup',function(){
//do the custom close...
});
}
}//...
To view this discussion on the web visit https://groups.google.com/d/msgid/glujs/ebd61e69-1455-4b6c-9685-0483edb22d26%40googlegroups.com.