Cordova s​​qlite TypeError:未定义不是对象(正在评估“ db.transaction”)(由“未定义”引起)

时间:2019-01-03 12:39:59

标签: ionic-framework

Iam正在从事离子工作,正在致力于应用程序。我正在使用SQLite插件(Cordova-sqlite-storage“),并通过xcode模拟器运行我的应用。但是登录时出现错误,EXCEPTION RISED TypeError:未定义不是对象(正在评估“ db.transaction”)(由引起“未定义”。下面提到了代码。请让我知道出了什么问题。谢谢。

.controller('login', ['$scope', '$location', '$controller', '$dataBaseSelect', '$cordovaSQLite', '$cordovaDevice','$ionicPlatform', function ($scope, $location, $controller, $dataBaseSelect, $cordovaSQLite, $cordovaDevice,$ionicPlatform) {

        $scope.doLogin = function (username, pwd) {
            $scope.error = '';
            try {
                window.plugins.spinnerDialog.show(null, null, true);

                var loginController = $controller('$loginController', { $scope: $scope });
                var promise = loginController.processLogin(username, pwd);

                promise.then(function (success) {

                    var syncController = $controller('$syncController', { $scope: $scope });

                    window.plugins.spinnerDialog.hide();
                    syncController.doSync();
                    alert("syncController hide");
                }, function (fail) {
                    alert("From root controller login");
                    window.plugins.spinnerDialog.hide();
                });
            } catch (e) {
                //alert("Something went wrong! :"+e);
                window.plugins.spinnerDialog.hide();
            }


        },

            $scope.initilizeCommit = function (cache) {
                var rootLMSController = $controller('rootLMSController', { $scope: $scope });
                rootLMSController.processLMSCommit(cache);
            }

    }])

0 个答案:

没有答案