-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(carousel): use $interval instead of $timeout #1630
Conversation
I know the tests fail and that's the only thing a need some help with, because I have no idea how to get the active |
I seriously hate my phone. Anytime I start a draft on it, it will I was going to say... you need to use interval.flush, although i'm not too I believe its the right way to go for the carousel. On Tue, Jan 21, 2014 at 8:39 AM, jkurz25@gmail.com jkurz25@gmail.comwrote:
Josh Kurz |
The thing is that the behavior of PS: @joshkurz Phones can be a pain in the ass sometimes |
well there is a clock tick function that jasmine offers you can use. On Tue, Jan 21, 2014 at 10:11 AM, Marcellino van Hecke <
Josh Kurz |
Angular's $interval tests doesn't help? (from ignorance): https://github.com/angular/angular.js/blob/master/test/ng/intervalSpec.js |
@bekos I tried the same method as @joshkurz, but all tests fail when I use that method. @Foxandxss It only confirms what I already knew. Let me try and explain where it goes wrong (English isn't my native language). At the moment my promise, |
@Gamemaniak what is the added value of this change? |
@pkozlowski-opensource Primarily for performance reasons because a carousel doesn't need that exact timing. It's |
@Gamemaniak I didn't know that we've got performance issues with carousel :-/ |
@pkozlowski-opensource Not really an issue and yes it's more a micro micro-optimization as you call it. Bootstrap is also used on mobile devices so a high performance is a good thing if it's possible in my opinion. |
agreed and it would save some LOC. On Tue, Jan 21, 2014 at 1:40 PM, Marcellino van Hecke <
Josh Kurz |
it just seems like using timeouts to perform interval like functionality is On Tue, Jan 21, 2014 at 1:43 PM, Josh Kurz jkurz25@gmail.com wrote:
Josh Kurz |
I agree, if this doesn't break anything, it is always a best way to do it. |
Any ideas on how I could expose the interval to testing properly? Everything functions as expected and only testing is still an issue. |
This change would also make it possible to use protractor for testing pages with a carrousel on it. (see #1308). Currently you are unable to use protractor to test any page with a AngularUI carrousel on it. |
Hi folks, Following up on a kind of stale issue here. Protractor end to end tests will wait before every action until Angular says it's synchronized. This means that all $timeouts are done. If someone is using a carousel, this will never happen, since it uses $timeout indefinitely instead of $interval. Any chance you could take another look at this change? |
Use the $interval service instead of the $timeout service for the carousel.