Skip to main content
Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.

Steven Wexler

Member since Mar 24, 2015

Recent Blog Comments By Steven Wexler

  • Forcing $q .notify() To Execute With A No-Op In AngularJS

    Posted on Mar 27, 2015 at 1:47 AM

    That's a really clever way to implement "synchronous" notify! I usually invoke notify in a $timeout to get around this. get("/foo").then(handleResolve, null, handleResolve): function get(url) { var deferred = $q.defer(); if (cachedData) { $timeout(function () { deferre... read more »

  • $q.when() Is The Missing $q.resolve() Method In AngularJS

    Posted on Mar 24, 2015 at 12:53 AM

    I thought the same thing when I first started using promises. In fact I went as far as writing $q.noop before discovering $q.when. $q.noop = function () { var deferred = $q.defer(); deferred.resolve(); return deferred.promise; }; I do have one gripe about $q.when though. $q.when(myFunc) w... read more »