Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

Why does a newly created record has hasDirtyAttributes to true?

$
0
0

@Frank wrote:

I’m creating a record using store.createRecord('record'); which is part of another record with a belongsTo relationship.

When I create this record, it gets created with hasDirtyAttributes to true already, making an action button appear whereas I only want to it to appear if the user start filling the form fields.

I was thinking of saving the record after its creation but I don’t have any POST call associated with this model, it’s part of another object that get saved later. I don’t know if that would have fixed the problem.

Is that normal? And if that’s the expected behavior, how can I set hasDirtyAttributes to false upon creation? If that’s not the expected behavior, anyone has an idea why this is happening?

Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles