2

$scopeは持っています:

$scope.current_account_key-私の更新モーダルからのキー

$scope.current_accountname: $scope.current_account.name、および説明$scope.current_account.description(アカウントは私のエントリです)を持ちます。

これらの値で Firebase のエントリを更新したいと考えています。

Firebase ツリー:

accounts
    -JL7e0Obv18-Ls6TTkk8
        description
        name
4

1 に答える 1

3

2 つの方法でそれを行うことができます。

アカウントを取得して特定の子を取得し、子を更新して保存できます

var ref = new Firebase(fbUrl + '/accounts');
var accounts = $firebase(ref);

var child = accounts.$child(key);
// Set any value to child and save
// child.name = 'changed name';
child.$save();

(または)

子要素を直接取得する

var ref = new Firebase(fbUrl + '/accounts/' + key);
$scope.account = $firebase(ref);

// Set any value to account and save
// account.name = 'changed name';
$scope.account.$save();
于 2014-04-22T10:39:32.037 に答える