Sunday, 15 March 2015

dart - Replacing an item in List causes NotFoundError in AngularDart -



dart - Replacing an item in List causes NotFoundError in AngularDart -

"replace" called if click on <a class="replace" href="#" ng-click="replace(musician.lastname)">[ repl ]</a>

class="lang-dart prettyprint-override">void replace(final string lastname) { _zone.run(() { final address addressfromlist = _model.musicians.firstwhere((final address address) => lastname == address.lastname); final int index = _model.musicians.indexof(addressfromlist); _logger.info("replace $lastname (index: $index)"); _model.musicians[index] = new address("tina","turner"); }); }

if index 0 (first one) works fails others:

notfounderror: node before new node inserted not kid of node. stacktrace: #0 blinknode.insertbefore_callback_node_node (dart:_blink:270) #1 node.insertbefore (dart:html:23205) #2 node.insertallbefore (dart:html:22868) #3 dominsert (package:angular/core_dom/dom_util.dart:25:25) #4 animate.insert (package:angular/core_dom/animation.dart:44:19) #5 viewport.insert.<anonymous closure> (package:angular/core_dom/view.dart:75:22) ...

gh: http://goo.gl/koeakc (replace function) gh: http://goo.gl/4ffylo (appcontroller)

here js version: http://www.mikemitterer.at/fileadmin/sourcesamples/accordion/ (same result)

in sample, if replace "mozart" "tina turner" works if replace "mercury" tt fails...

dart angular-dart

No comments:

Post a Comment