Using jQuery Deferred.notify() To Provide Locally Cached Data
Updated: 2012-09-27 15:57:00
Most of the data in your application hasn't changed. Sure, things are being updated all the time; but, the large majority of the data remains the same from moment to moment. As such, it might make sense to show the user outdated, locally cached data before taking the time to go to the server for the true data. But how can we do this in a way that is really clear for your application Controllers? In jQuery 1.5, we were given Deferred objects to handle our asynchronous, server-side requests. In ... ead More raquo;

As I have been trying to learn AngularJS, one of the biggest stumbling blocks [for me] is the extreme separation of the Controller layer from DOM (Document Object Model) manipulation. In an AngularJS application, none of the Controllers are supposed to touch the document in anyway; all mutation should be done through the two-way data binding. If you do need to touch the DOM, you need to use (or create) an AngularJS Directive. As a learning experiment, I wanted to see if I could come up with a ... ead More raquo;