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.
Hi, I've some model:
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:
but that's not work- empty array assigned.
But if I do:
and after that repeat same assignment:
all work as expected.
Why I can't assign m2 model's array directly without intermediate step?
Thanks.