Yes, I could generify it, but I'd have implement $q and $http (or introduce other dependencies), and extract angular-specific things like hooking into Angular's $digest cycle for change detection (when the browser doesn't support Object.observe).
This definitely warrants some thought. The next time I write a non-trivial application in a framework other than Angular then this will move up on my priority list. Or perhaps when the community wills it into existence :)
This definitely warrants some thought. The next time I write a non-trivial application in a framework other than Angular then this will move up on my priority list. Or perhaps when the community wills it into existence :)