You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
$timeout returns a promise that has been "decorated" with a $$timeoutId that is then required when attempting to cancel the timeout via $timeout.cancel(promise). When chaining to this promise upon creation (i.e. then, catch, and/or finally), the promise returned from the chained function(s) is a new promise that does not contain $$timeoutId.
Expected / new behavior:
Ideally, Angular.js would not be adding properties willy-nilly to this promise. Secondly, it would be great if the chained calls would return back any extra properties set on the original promise (i.e. $$timeoutId). BUT, it would suffice if the documentation for $timeout could be enhanced to provide a note about this limitation.
Minimal reproduction of the problem with instructions:
Plnkr - Take note that this is built with a chained catch and causes the timeout to not be canceled. If you remove the chained catch or move the catch to a separate line after initial assignment, it cancels just fine.
AngularJS version:
1.6.6
Browser:
All
Anything else:
I strongly would consider this a defect but because I don't think you're going to change your underlying then, catch, and finally implementation to copy any ole' properties from the chained promise, documentation would suffice for any other future souls.