Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$timeout example not working #5232

Closed
Drvanon opened this issue Dec 2, 2013 · 2 comments
Closed

$timeout example not working #5232

Drvanon opened this issue Dec 2, 2013 · 2 comments

Comments

@Drvanon
Copy link

Drvanon commented Dec 2, 2013

The example of ng.$timeout does not work, as it is the only manually written docs, I think it would be worth it to correct it. The StopFight button has no effect on the countdown.

I am using chromium 31.0.1650.48 on archlinux (gnome).

@petebacondarwin
Copy link
Contributor

Yes you are right. This is because there was an issue with $timeout and e2e tests - so there was a hack in there to change how timeouts were run in the docs.
See https://github.com/angular/angular.js/blob/master/docs/components/angular-bootstrap/bootstrap-prettify.js#L218-L228
Now the issue has been resolved by utilizing $interval we ought to get rid of the hack.

@petebacondarwin
Copy link
Contributor

I have fixed this by removing the hack and changing the end2end test (which was in guide/directive) to use $interval. But I realised that the example for $timeout is actually no longer appropriate. This example is exactly what $interval is for. So I am going to move the over there instead. Perhaps someone would like to suggest a better $timeout example that doesn't involve timeouts that trigger themselves, which is what interval is for.

jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
End 2 end tests wait for all `$timeout`s to be run before completing the test.
This was problematic where we were using timeouts that restarted themselves because
there would never be a point when all timeouts had completed, causing the tests to hang.

To fix this $timeout had been monkey-patched but this caused other issue itself.

Now that we have $interval we don't need to use $timeout handlers that re-trigger the $timeout
so we can ditch the monkey-patch.

This commit tidies up any examples that are using this approach and changes them to use $interval
instead.

Closes angular#5232
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
End 2 end tests wait for all `$timeout`s to be run before completing the test.
This was problematic where we were using timeouts that restarted themselves because
there would never be a point when all timeouts had completed, causing the tests to hang.

To fix this $timeout had been monkey-patched but this caused other issue itself.

Now that we have $interval we don't need to use $timeout handlers that re-trigger the $timeout
so we can ditch the monkey-patch.

This commit tidies up any examples that are using this approach and changes them to use $interval
instead.

Closes angular#5232
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants