Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Overriding controller destroy to wrap 'nulled' element - bad idea?

$
0
0

 Yeah, I thought of deferreds too.  It's just too much manual glue to bother with.  If I find a good pattern I'll abstract it and share it here but for now I'm just using

Well, you could just make your asynchronous actions trigger an event on the controller's DOM element and use the templated event bindings to attach the continuation logic. Templated event bindings get cleaned up automatically, so no fuss.

If you have something inside the continuation logic which your controller absolutely must process to keep your application in a valid state, then you're probably putting domain/model logic in your controller, which is a no-no. That would be a different concern to address.


Viewing all articles
Browse latest Browse all 3491

Trending Articles