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
varPost=model('Post').attr('id').attr('title').attr('slug').attr('content').attr('author');varpost=newPost({title: "My new post",content: "My awesome post content"});post.save(function(err,res){post.slug()// undefinedres.body.slug// "my-new-post"post.author()// undefinedres.body.author// "Cristian Douce"});
It would be nice to have this kind of sync between model instance and server response object. Now I have to manually set an onsave callback and update model manually with the con of having my model dirty after that. Not nice :(
The text was updated successfully, but these errors were encountered:
A use case:
It would be nice to have this kind of sync between model instance and server response object. Now I have to manually set an
onsave
callback and update model manually with the con of having my modeldirty
after that. Not nice :(The text was updated successfully, but these errors were encountered: