I don't find the way to update an item (You can find all the code here) I tried with this code
app.factory('Items', function($firebase,FIREBASE_URL) {
var ref = new Firebase(FIREBASE_URL);
var items = $firebase(ref.child('items')).$asArray();
var Item = {
all: function () {
return items;
},
create: function (item) {
return items.$add(item);
},
get: function (itemId) {
return $firebase(ref.child('items').child(itemId)).$asObject();
},
update: function (itemId, item) {
return $firebase(ref.child('items').child(itemId)).update(item);
},
delete: function (item) {
return items.$remove(item);
}
};
return Item;
});
but it doesn't work. Can you help me, please ?
I've tried after the comment of Frank van Puffelen to
update: function (item) {
return items.$save(item);
}
but it doesn't work and get me
Object { status=2, value="Invalid record; could d...ts key: [object Object]"}
You can see a workish example at :