You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating, Updating and Deleting fragments in Fragment Array works fine for a new model (isNew: true)
On an existing model from server, deleting a fragment inside fragmentArray removes it from the model and setting hasDirtyAttributes to true. But while saving the model using model.save empty object is sent to server (Only on PUT Request)
// Data from server
{
"person" : {
"name" : "Benedict Cumberbatch",
"address" : [{
"street" : "77A Bleecker Street",
"city" : "New York City",
"region" : "New York",
"country" : "US"
}, {
"street" : "221B Baker Street",
"city" : "London",
"region" : "England",
"country" : "UK"
}],
"titles" : ["Doctor Strange", "Sherlock Holmes"]
}
}
I am removing one of the addresses from the fragmentArray
letaddresses=this.model.get('addresses');addresses.objectAt(0).removeFragment();// Also Tried this =>// addresses.objectAt(0).removeObject();this.model.save();
After this the data sent to the server is an empty object
// Data to server
{}
When I remove any fragment from the fragmentArray, hasDirtyAttributes is set as true for the model and the fragmentArray. But no data was sent to server on PUT request using model.save()
@prabakaranfresh Were you ever able to resolve this? It's still a blocking issue for me and I'm debating if I should create an entire workaround instead of using fragments.
Creating, Updating and Deleting fragments in Fragment Array works fine for a new model (
isNew: true
)On an existing model from server, deleting a fragment inside fragmentArray removes it from the model and setting
hasDirtyAttributes
totrue
. But while saving the model usingmodel.save
empty object is sent to server (Only on PUT Request)I am removing one of the addresses from the fragmentArray
After this the data sent to the server is an empty object
// Data to server {}
When I remove any fragment from the fragmentArray,
hasDirtyAttributes
is set astrue
for the model and the fragmentArray. But no data was sent to server onPUT
request usingmodel.save()
Referred this Issue: Remove fragment from fragment array? But mine happens only on
model.save()
The text was updated successfully, but these errors were encountered: