我如何在firebase上获取ID

时间:2016-03-02 14:33:17

标签: angularjs firebase angularfire

我似乎无法获得身份证件。它返回的所有内容都是cannedLst.name,但我似乎无法获取ID。

.controller("Canned", ["$scope", "$firebaseArray","Data", function($scope, $firebaseArray, $ionicModal, Data) {
    $scope.deleteItem = function(cannedLst) {
    $scope.cannedLsts.$remove(cannedLst); 
    };

    $scope.addData = {};
    $scope.addPrice = function() {

      var price = $scope.addData.store1price;
      var editRef = new Firebase('https://pricemonitoringsys.firebaseio.com/dti/-KB7IIkAqZ07SfUOKw0l');
      editRef.update({ 
        store1price: price
      });
    };

    var cannedRef = new Firebase("https://pricemonitoringsys.firebaseio.com/dti")
    $scope.cannedGoods = $firebaseArray(cannedRef);
    var query = cannedRef.orderByChild("category").equalTo("canned");
    $scope.cannedLsts = $firebaseArray(query);
  }
])

0 个答案:

没有答案