akserg / angular.dart.ui

Port of Angular-UI to Dart.
angulardartui.com
Other
101 stars 37 forks source link

[Carousel] "Transition cancelled" in Dev Tools console #164

Closed cedx closed 8 years ago

cedx commented 9 years ago

I don't know if it's really an issue as this is not blocking, and I'm quite novice in AngularDart development.

I've a carousel on several pages of my application. Their slides are a populated by a REST service when the page components are instantiated by Angular. The navigation between the pages is handled with the standard routing and ng-view components.

Everything is working fine. No problem from the point of view of an end user. But sometimes, when I navigate from a page containing a carousel to another page, the following output is printed in my Dev Tools console:

Transition cancelled

STACKTRACE:
null
RangeError (index): Invalid value: Only valid value is 0: 0

STACKTRACE:
#0      List.[] (dart:core-patch/growable_array.dart:136)
#1      Carousel._goNext (package:angular_ui/carousel/carousel.dart:140:29)
#2      Carousel.select.<anonymous closure> (package:angular_ui/carousel/carousel.dart:131:26)
#3      Timeout.call.<anonymous closure> (package:angular_ui/utils/timeout.dart:74:31)
#4      _rootRun (dart:async/zone.dart:900)
#5      _ZoneDelegate.run (dart:async/zone.dart:503)
#6      VmTurnZone._onRun.<anonymous closure> (package:angular/core/zone.dart:122:55)
#7      VmTurnZone._onRunBase (package:angular/core/zone.dart:108:16)
#8      VmTurnZone._onRun (package:angular/core/zone.dart:122:7)
#9      _CustomZone.run (dart:async/zone.dart:803)
#10     _CustomZone.runGuarded (dart:async/zone.dart:709)
#11     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:734)
#12     _WrappedTimer._WrappedTimer.<anonymous closure> (package:angular/core/zone.dart:319:9)
#13     _rootRun (dart:async/zone.dart:904)
#14     _ZoneDelegate.run (dart:async/zone.dart:503)
#15     VmTurnZone._onRun.<anonymous closure> (package:angular/core/zone.dart:122:55)
#16     VmTurnZone._onRunBase (package:angular/core/zone.dart:108:16)
#17     VmTurnZone._onRun (package:angular/core/zone.dart:122:7)
#18     _CustomZone.run (dart:async/zone.dart:803)
#19     _CustomZone.runGuarded (dart:async/zone.dart:709)
#20     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:734)
#21     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:16)
#22     _Timer._Timer.<anonymous closure> (dart:html:42474)

This happens with Dartium, as well as with compiled JS under Chrome.

Dart: 1.12.1 AngularDart: 1.1.2 AngularUI: 0.6.9 WebComponents: 0.12.0

akserg commented 9 years ago

Hi Cédric,

I changed the code and published library on Pub. Please use latest version (0.6.10) to check is my changes fix issue you mentioned here.

cedx commented 8 years ago

The output has changed but it is still here :

Transition cancelled

STACKTRACE:
null

The carousel is still working fine.

akserg commented 8 years ago

I made other changes regarding to your logs. Please use latest version (0.6.11) to check is changes help. If it doesn't help - I need info to repeat this issue.

cedx commented 8 years ago

Same output and behavior as before (e.g. Transition cancelled printed and no stack trace). But I think the issue is fixed when I look (naively) at your code.

The unique statement that I don't understand is on line 133: _currentTransition.completeError('Transition cancelled');

Why do you consider that the transition cancellation should complete as an error? In the current case, this is exactly what occurs: a transition is in progress, but a route change interrupts it. This is a standard behavior of stopping the transition as we are changing the page content, thus removing the carousel.

In what other cases transition cancellation occurs?

cedx commented 8 years ago

I close this issue as the bug is fixed for me :) The console output is not anymore related to the raised bug.

akserg commented 8 years ago

Ok.