将数据写入firebase无效

时间:2017-03-13 21:22:21

标签: javascript angularjs firebase web firebase-realtime-database

我正在尝试向firebase插入一些数据,但是它没有定义customerName。我不明白代码的问题是什么。以下是我的代码。谢谢。

var orderDetailsRef = database.ref('orderDetails'); 
    var customerName = $scope.CustomerName;
    var customerContactNumber = $scope.customerContactNumber;
    var pickdroneId = $scope.pickdroneId;
    var orderId = $scope.orderId;
    var orderDate = $scope.orderDate
    var result = orderDetailsRef.push({
        customerName: CustomerName,
        customerContactNumber: customerContactNumber,
        pickdroneId: pickdroneId,
        orderId: orderId,
        orderStatus: "Initiated",
        orderDate: orderDate
    });
    console.log(result);
}

0 个答案:

没有答案