I have a small and quite standard application that:
DS.hasMany
attributes.The app controller handles a save
event, and there I store the stuff. The code looks like this:
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
save() {
this.store.peekAll('object').forEach(obj => {
obj.save();
});
}
}
});
This issues a PUT request for each object locally loaded. It works fine, but it is a little bit of brute force. Instead, I would like to save only the modified objects.
I have tried with dirtyType, but it returns undefined
inside of the .forEach
, and also hasDirtyAttributes, but it returns false
always.
I could build my own cache of modified objects, but that would be a lot of work and error prone. Is there any standard way of handling this situation? thanks in advance.
I'm looking for a list of time zones that corresponds to major cities. Like what java.util.TimeZone can provide. I mean, I want to resolve the America/Los_Angeles identifier to UTC-8:00 in javascript. ...
I'm looking for a list of time zones that corresponds to major cities. Like what java.util.TimeZone can provide. I mean, I want to resolve the America/Los_Angeles identifier to UTC-8:00 in javascript. ...
Please look at below codes: Case 1: var a = { b: function(){ console.log(a) }, c:1 }; Case 2: var a = { b:a, c:1 }; Now when I write this : a.b() // for first console....
Please look at below codes: Case 1: var a = { b: function(){ console.log(a) }, c:1 }; Case 2: var a = { b:a, c:1 }; Now when I write this : a.b() // for first console....
I get this error from the TrackballControls.js: this.domElement.addEventListener is not a function This occurs when I assign the TrackballControls to a DOM: // 'container' is a variable var ...
I get this error from the TrackballControls.js: this.domElement.addEventListener is not a function This occurs when I assign the TrackballControls to a DOM: // 'container' is a variable var ...
I'd like to augment all Objects in my Node.js application with a logging function, such that each object can call this.log or have its log function referenced by thatObject.log. I see a number of ...
I'd like to augment all Objects in my Node.js application with a logging function, such that each object can call this.log or have its log function referenced by thatObject.log. I see a number of ...