-
Notifications
You must be signed in to change notification settings - Fork 248
NgRepeat compiled to JS throws NullError #1097
Comments
@vicb I don't know exactly how to apply the commits you mentioned; however, I performed a checkout of angular.dart master, I copied the raw version of the NgRepeat from #1018 (I added a print to the constructor to be sure it was used) and then I modified my library to use angular from local path. |
Some other things you can do to investigate:
Thanks |
@vicb I performed different attempts but no luck at all. |
Firefox does not work (as reported) My setup:
|
Seems like I can trigger the error finally, I'll take a deeper look |
For now it seems like a bug in the change detection, see what happens when dragging an item to the bottom of the list:
We should not remove / destroy at index 9 - we should only swap the two last els (8 & 9) I have now to check if this is also applicable to the Dart version... and fix it :) |
The Dart version is fine
|
This snippet shows the bad behavior (also in Dart)
I don't know why but this seems to work in a unit test ! |
Ah got it: it works in checked mode, fails in non checked mode - nothing to do with JS vs Dart |
@vicb wow! You're going fast 👍 Thank you. I'm looking forward to see this fixed! |
I have a fix but I need to make sure everything is correct before merging, this code is critical |
Thanks Victor, Sergey. |
Well I'm quite happy to have fixed this bug that I was chasing for some time - thanks @ufoscout for having provided a repro. |
@vicb you fixed it in less than 24 hours! impressive! I really need to thank you. |
closes #1097 Conflicts: lib/change_detection/dirty_checking_change_detector.dart
We are preparing a Sortable component for the next version of the Angular UI library (https://pub.dartlang.org/packages/angular_ui).
It works fine in Dartium, but when compiled to JS, the NgRepeat directive often throws a NullError.
Here the error stack in Chrome:
And here the staketrace in FF (similar but not the same):
To reproduce the issue, checkout the dragdrop branch (https://github.com/akserg/angular.dart.ui/tree/dragdrop) and compile it to JS (pub build). Open the build result in a browser, drag of an element of a sortable list performing fast movements with the mouse. The exception is thrown multiple times and the content of the list is corrupted.
As stated before, everything works perfectly with Dart code in Dartium.
The text was updated successfully, but these errors were encountered: