Issue:
whenever I am inserting Entries in model2, then model1 automatically get updated
and that’s why model1 have two entries of one record, I am facing record duplication issue.
I don’t know what v is, but I assume it’s a JavaScript Object that has a “ruledetails” property that is an Array. My question is whether the two models both have data objects that refer to the same Array, so that you are effectively inserting the same value of a twice. I think you need to make sure that those Arrays are not shared between the two models.
Why are you passing the same Array twice to the calls to Model.insertArrayItem? Shouldn’t you be modifying two different arrays, one that is in model1 and one that is in model2?
Please explain what you are trying to do with this code. obj.part is in which Diagram? obj.part.data is in which model?
Why are you passing the same Array to both models in your calls to Model.insertArrayItem?
Why are you inserting the same value a twice into the same Array?