David Bennett
David Bennett
My latest PR is an alternate approach that overloads the `timeout` property on `$http` requests to support promises. This can (with a little extra setup) give you the same effect...
Yes, it's in the 1.1.5 release ([changelog](https://github.com/angular/angular.js/blob/master/CHANGELOG.md)). Here's the example I had above: ``` javascript var canceler = $q.defer(); $http.get('/someUrl', {timeout: canceler.promise}).success(successCallback); // later... canceler.resolve(); // Aborts the $http request...
@coli, yes, I tried several different approaches (see PRs #1623, #1836, #2452, #2523). None of them were approved. See also: https://github.com/angular/angular.js/pull/2529#issuecomment-17268965
You need to wrap your code with scope.$apply. Bind doesn't do it implicitly.
Hmm, I think the $http.post doesn't fire the request until the next digest cycle. So the canceler.resolve is canceling it before it happens. Try putting a scope.$apply between the $http.post...
@markstickley You can just use the promise returned by $timeout and then do $timeout.cancel(promise) if you want to cancel the request early.
Here is a jsFiddle that reproduces the issue: http://jsfiddle.net/dbinit/tMmKf/
In my case, I wasn't using $location at all. It was just getting pulled in by $anchorScroll, which is used by ngInclude. I wasn't using $anchorScroll either, so I just...
I'm seeing this too. From what I can tell, it looks like every top level element in transcluded content (including whitespace) is being assigned the same scope (stored in data())....
Changing that line from: ``` this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null; ``` to: ``` this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null; ``` Also...