I've this $timeout set inside my script and its code was wrote like this:
timeout = $timeout(function () {
scope.eventHandler.apply(this, arguments);
}, scope.ngDebounceOptions.time)
timeout.then(function(){},function(){},function(){})
After setting the var timeout I got this result when I fire JSON.stringify(timeout):
{"$$state":{"status":0,"pending":[[{"promise":{"$$state":{"status":0}}},null,null,null]]},"$$timeoutId":210}
And I'got this result when when I fire JSON.stringify(timeout) after timeout time elapse:
{"$$state":{"status":1,"processScheduled":false},"$$timeoutId":86}
My question is: how to check if timeoout has status 0 or 1?