Giter Site home page Giter Site logo

Comments (2)

fkleuver avatar fkleuver commented on May 15, 2024 1

@ghiscoding Hey :) if this was indexed assignment you would have been correct, but here I'm reassigning a new array instance (thus completely replacing the old one). The observation side of things works as it should.

Perhaps interesting to note, that now we have things like proxies we might be able to support even observing indexed assignment. We'll be looking into that some later point in time.

In any case, the mutation is registered correctly because in the debugger I could see the repeater attempting to remove the views. But the logic that removes the views ends up removing the wrong nodes from the DOM.

from aurelia.

ghiscoding avatar ghiscoding commented on May 15, 2024

@fkleuver
Could that be a binding issue with a mutation (assignment) that Aurelia cannot see? I had a similar issue and asked on SO here in which Jeremy Danyow replied:

Aurelia observes changes to the contents of an array by overriding the array's mutator methods (push, pop, splice, shift, etc). This works well for most use-cases and performs really well (no dirty-checking, extremely lightweight in terms of memory and cpu). Unfortunately this leaves one way of mutating an array that aurelia can't "see": indexed assignment... eg myArray[6] = 'foo'. Since no array methods were called, the binding system doesn't know the array changed.

from aurelia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.