Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-repeat behavior inconsistency with js objects #1430

Closed

Description

@SteveShaffer

There seems to be very different behavior between the two forms of ng-repeat, the "thing in things" and "(key, value) in things".

Please see this jsfiddle: http://jsfiddle.net/ktDUW/3/

In each case, the behavior is different, and none of those cases work for me for direct editing of javascript object properties (like a dictionary/hash).

I could be missing something, but if I'm not, I think there should be a note in the documentation about the different behaviors and possibly the best options for certain use cases.

Activity

  1. gleber commented on Oct 2, 2012

    @gleber

    I am hitting this particular problem myself. The way to avoid it is to use complex objects as values in the object. But this is hacky. I would love to see this fixed.

  2. petebacondarwin commented on Dec 6, 2012

    @petebacondarwin
    Contributor

    The problems in case 2 & 3 are to do with JavaScript. Primitive types are passed by value and so the inner scope has no way of knowing that it should update the value on the outer scope.
    The last case is fixed in this PR: #1661. You should probably track that to see if it gets into master at some point!

  3. SteveShaffer commented on Dec 7, 2012

    @SteveShaffer
    ContributorAuthor

    Cool. Thanks Pete.

  4. darkyen commented on Jul 28, 2014

    @darkyen

    This saved me half a day of work :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions