小编Abd*_*tan的帖子

错误:Reference.push失败:第一个参数在属性中包含一个函数-Firebase

我正在尝试将值推入我的Firebase数据库。当我尝试推送值时,它在控制台中给我一个错误(错误:Reference.push失败:第一个参数在属性中包含一个函数)。我在firebase上进行了查找,发现这是因为某个功能被推送了,但是我根本没有推送任何功能。但是我感觉可能是因为datetimepicker。需要帮忙!

我的JS

/*global angular*/
var app = angular.module('downtime', ['ngRoute', 'firebase']);

app.config(['$routeProvider', function ($routeProvider) {
    'use strict';
    $routeProvider.when('/downtime', {
        templateUrl: 'downtime/downtime.html',
        controller: 'downtimeCtrl'
    });
}]);

app.controller('downtimeCtrl', ['$scope', '$firebaseObject', '$firebaseArray', function ($scope, $firebaseObject, $firebaseArray) {
    'use strict';

     $scope.allEquipments = [];
     $scope.allSystems = [];

    $scope.manageDowntime = function () {

        var doesExist = false;
        angular.forEach ($scope.data , function (d) {
        angular.forEach (d.equipments, function (e) {
        })
    });
        firebase.database().ref('downtime/' + $scope.equipment + '/downtime').push({
            equipment: $scope.equipment,
            type : $scope.type,
            start: $scope.startDT,
            end: $scope.endDT
        });
};

    var …
Run Code Online (Sandbox Code Playgroud)

html datetimepicker angularjs firebase firebase-realtime-database

5
推荐指数
1
解决办法
2934
查看次数