【问题标题】:Successfully push the record into Firebase, but Google Chrome hangs while pushing the data成功将记录推送到 Firebase,但谷歌浏览器在推送数据时挂起
【发布时间】:2017-08-21 17:11:24
【问题描述】:

这是我的应用程序的控制器文件。它完美地添加了数据,但是当它到达然后关键字谷歌浏览器挂起但关键参数也被添加到数据库中。我不知道问题出在哪里。

 .controller('recordsCtrl', ['$scope','$firebaseArray',function($scope,$firebaseArray) {

        $scope.records = $firebaseArray(rootRef);

        //show form
        $scope.showAddForm = function(){
            $scope.addFormShow = true;
        }

        // hide form
        $scope.hide = function(){
            $scope.addFormShow = false;
        }

        // submit contact
        $scope.addFormSubmit = function() {

            console.log("adding form...")
            // Assign values
            if ($scope.lname) { var lname = $scope.lname; } else { var lname = null; }
            if ($scope.mname) { var mname = $scope.mname; } else { var mname = null; }
            if ($scope.fname) { var fname = $scope.fname; } else { var fname = null; }
            if ($scope.email) { var email = $scope.email; } else { var email = null; }      if ($scope.conId) { var conId = $scope.conId; } else { var conId = null;}


            // Build Object
            $scope.records.$add({

                fname: fname,
                lname: lname,
                mname: mname,
                email: email,
                company: company,         
                conId: conId

            }).then(function(rootRef) {
                ***//this is not printed in the console but the key is assigned to the database***
                console.log("Assign root key");
                var id = rootRef.key();
                console.log("Added Record with ID: " + id);

                // clear Form
                clearFields();

                // Hide Form
                $scope.addFormShow = false;

                // send message to use
                $scope.msg = "Record Added";
            });
        }

    }]);

【问题讨论】:

    标签: html angularjs firebase bower angularfire


    【解决方案1】:

    当我们更新到 Firebase 3.7.x 时,我的团队遇到了这个问题。我相信这是一个已知的错误。

    尝试降级到 Firebase 3.6.x。

    【讨论】:

    • 我也尝试过降级,但问题仍然存在..现在更新记录时出现了新问题...它不会将更新的记录保存到数据库中..我可以分享我的吗github链接与你..你可以看看我的代码。如果这对你来说不是问题
    猜你喜欢
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 2013-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-22
    • 2020-12-18
    相关资源
    最近更新 更多