Splicing from array bound to a repeater issue

I’ve just updated a few aurelia packages in an app I’m working on and a bug has cropped up, so I assume it’s related to one of these. (There were a few others but not sure they’re related):

  • aurelia-binding 1.5.0
  • aurelia templating 1.6.0
  • aurelia-templating-resources 1.5.3

I have a basic repeater showing array items:

<div repeat.for"item of items">...</div>

and to delete from the array I use splice:

delete(item) {
    var index = this.items.indexOf(item);
    if (index != -1) {
        this.items.splice(index, 1);
    }
}

which has been working fine till now. Since the upgrade, two items disappear from the view even though the array only splices one, and I get strange errors from bind() methods in sub elements. (“cannot read property ‘x’ of undefined” from aurelia-task-queue)

Has anyone seen this behaviour? I’ll create a report and reproduce it on github, but that takes time and I’m hoping someone else has some hints.

thanks!

2 Likes

I’m using

aurelia-binding 1.5.0
aurelia-templating 1.6.0
aurelia-templating-resources 1.5.4

It’s all working fine for me

2 Likes

Well I don’t know how I missed that… aurelia-templating-resources 1.5.4 has fixed it even though I thought I took the latest version on Friday.

Thanks!

Thanks for asking this too, may help others who using < 1.5.4 :+1: