I recently worked with corner fire and firebase. I am not sure if this is a fix, but I donโt think you need to explicitly select the property of the element that you want to update when using the $ save () method.
, init,
HTML
<ul ng-repeat="user in vm.users>
<button ng-click="vm.updateUserInit(user)">Edit</button>
</ul>
. $firebaseObject.
var selectedUser;
vm.updateUserInit = function (user) {
var ref = new Firebase("https://<foo>.firebaseio.com/users/" + user.$id);
selectedUser = $firebaseObject(ref);
}
firebase selectedUser $save.
,
HTML
<button type="button" ng-click="vm.updateUserDetails()">Update User Details</button>
, . , , .
vm.updateUserDetails = function () {
selectedUser.firstName = vm.firstName;
selectedUser.$save();
}
selectedUser.$save(); , 6
, , . valcon, . firebase
2
,
constructor(private db: AngularFireDatabase) {}
update(fbPath: string, data: any) {
return this.db.object(fbPath).update(data);
}
this.api.update(`foo`, ({ title: 'foo Title' }) );
user1752532