Skip to content

model set enumerable #303

Description

@sacesare

Hi, I've some model:

m1= {
   id: true,
   p1: '',
   p2: [ m2]
....

}
m2= {
   id: true,
   p2_1: ''
     ...
}

I want to change instance (in "draft" mode/cache= in memory), instance has some non empty array of models m2 in p2 property. That's important, because if p2 is empty array from begining, you can set property p2 to array of models m2 without problem:

store.set( m1_instance, { p2: [....]} )

but that's not work- empty array assigned.
But if I do:

store.set( m1_instance, { p2: []} )

and after that repeat same assignment:

store.set( m1_instance, { p2: [....]} );
or even
store.sync( m1_instance, { p2: [....]} );

all work as expected.
Why I can't assign m2 model's array directly without intermediate step?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    storeApplies to the store feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions