pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <i id='9OaYV'><tr id='9OaYV'><dt id='9OaYV'><q id='9OaYV'><span id='9OaYV'><b id='9OaYV'><form id='9OaYV'><ins id='9OaYV'></ins><ul id='9OaYV'></ul><sub id='9OaYV'></sub></form><legend id='9OaYV'></legend><bdo id='9OaYV'><pre id='9OaYV'><center id='9OaYV'></center></pre></bdo></b><th id='9OaYV'></th></span></q></dt></tr></i><div class="ck2qkiw" id='9OaYV'><tfoot id='9OaYV'></tfoot><dl id='9OaYV'><fieldset id='9OaYV'></fieldset></dl></div>
      <bdo id='9OaYV'></bdo><ul id='9OaYV'></ul>
    <tfoot id='9OaYV'></tfoot>

    <small id='9OaYV'></small><noframes id='9OaYV'>

    1. <legend id='9OaYV'><style id='9OaYV'><dir id='9OaYV'><q id='9OaYV'></q></dir></style></legend>

      1. 如何在 Ionic 框架中使用 ngCordova s??qlite 服務和

        How do I use the ngCordova sqlite service and the Cordova-SQLitePlugin with Ionic Framework?(如何在 Ionic 框架中使用 ngCordova s??qlite 服務和 Cordova-SQLitePlugin?)

          1. <small id='wvvBc'></small><noframes id='wvvBc'>

          2. <i id='wvvBc'><tr id='wvvBc'><dt id='wvvBc'><q id='wvvBc'><span id='wvvBc'><b id='wvvBc'><form id='wvvBc'><ins id='wvvBc'></ins><ul id='wvvBc'></ul><sub id='wvvBc'></sub></form><legend id='wvvBc'></legend><bdo id='wvvBc'><pre id='wvvBc'><center id='wvvBc'></center></pre></bdo></b><th id='wvvBc'></th></span></q></dt></tr></i><div class="es02ceo" id='wvvBc'><tfoot id='wvvBc'></tfoot><dl id='wvvBc'><fieldset id='wvvBc'></fieldset></dl></div>
            <legend id='wvvBc'><style id='wvvBc'><dir id='wvvBc'><q id='wvvBc'></q></dir></style></legend>
              <bdo id='wvvBc'></bdo><ul id='wvvBc'></ul>

                <tbody id='wvvBc'></tbody>
                  <tfoot id='wvvBc'></tfoot>

                • 本文介紹了如何在 Ionic 框架中使用 ngCordova s??qlite 服務和 Cordova-SQLitePlugin?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我一直在嘗試將 sqlite 合并到一個簡單的 Ionic 應用程序中,這是我一直遵循的過程:

                  I have been trying to incorperate sqlite into a simple Ionic app and this is the process I have been following:

                   ionic start myApp sidemenu
                  

                  然后我安裝sqlite插件:

                  Then I install the sqlite plugin:

                  ionic plugin add https://github.com/brodysoft/Cordova-SQLitePlugin
                  

                  和 ngCordova

                  and ngCordova

                  bower install ngCordova
                  

                  這給了我以下選項:無法找到適合 angular 的版本,請選擇一個:1) angular#1.2.0 解析為 1.2.0 并且 ngCordova#0.1.4-alpha 需要2) angular#>= 1.0.8 解析為 1.2.0 并且 angular-ui-router#0.2.10 需要3) angular#1.2.25 解析為 1.2.25 并且是 angular-animate#1.2.25、angular-sanitize#1.2.25 所需要的4) angular#~1.2.17 解析為 1.2.25 并且是 ionic#1.0.0-beta.13 需要的前綴選擇!將其持久化到 bower.json

                  this gave me the following options: Unable to find a suitable version for angular, please choose one: 1) angular#1.2.0 which resolved to 1.2.0 and is required by ngCordova#0.1.4-alpha 2) angular#>= 1.0.8 which resolved to 1.2.0 and is required by angular-ui-router#0.2.10 3) angular#1.2.25 which resolved to 1.2.25 and is required by angular-animate#1.2.25, angular-sanitize#1.2.25 4) angular#~1.2.17 which resolved to 1.2.25 and is required by ionic#1.0.0-beta.13Prefix the choice with ! to persist it to bower.json

                  我選擇了選項 3)我將腳本包含在文件中,如下所示:

                  I picked option 3) and I included the scripts in the file as follows:

                  <script src="lib/ionic/js/ionic.bundle.js"></script>
                  <script src="lib/ngCordova/dist/ng-cordova.js"></script>
                  <script src="cordova.js"></script>
                  <script src="js/app.js"></script>
                  <script src="js/controllers.js"></script>
                  

                  然后我在搜索視圖中添加了一個控制器:

                  I then added a controller to the search view:

                  .controller('SearchCtrl', function ($scope, $cordovaSQLite){
                    console.log('Test');
                     var db = $cordovaSQLite.openDB({ name: "my.db" });
                  
                          // for opening a background db:
                          var db = $cordovaSQLite.openDB({ name: "my.db", bgType: 1 });
                  
                          $scope.execute = function() {
                            console.log('Test');
                            var query = "INSERT INTO test_table (data, data_num) VALUES (?,?)";
                            $cordovaSQLite.execute(db, query, ["test", 100]).then(function(res) {
                              console.log("insertId: " + res.insertId);
                            }, function (err) {
                              console.error(err);
                            });
                       };
                  })
                  

                  這導致了錯誤:

                  > TypeError: Cannot read property 'openDatabase' of undefined
                  >     at Object.openDB  (http://localhost:8100/lib/ngCordova/dist/ng-cordova.js:2467:36) 
                  

                  接下來我嘗試通過以下方式手動包含 SQLitePlugin.js:從 plugins/com.brodysoft.sqlitePlugin/www 復制到主 www/ 并將其添加到索引中.html頁面

                  Next I tried manually including the SQLitePlugin.js by: copying from plugins/com.brodysoft.sqlitePlugin/www to main www/ and adding it to the index.html page

                  我嘗試在一切之前包括:

                  I tried including before everything:

                   <script src="SQLitePlugin.js"></script>
                  <script src="lib/ionic/js/ionic.bundle.js"></script>
                  <script src="lib/ngCordova/dist/ng-cordova.js"></script>
                  <script src="cordova.js"></script>
                  <script src="js/app.js"></script>
                  <script src="js/controllers.js"></script>
                  

                  我收到錯誤 ReferenceError:cordova 未定義所以我然后嘗試在cordova.js腳本之后包含它,但仍然得到相同的錯誤

                  I get Error ReferenceError: cordova is not defined so I then tried including it after the cordova.js script but still get the same error

                  非常感謝您的幫助如果相關,這些是我正在使用的 Cordova 和 ionic 的當前版本:

                  would really appreciate the help in case it is relevant, these are the current versions of Cordova and ionic I am using:

                  ionic --version  1.2.5
                  cordova --version 3.5.0-0.2.7
                  

                  這是生成的 bower.json

                  and this is the generated bower.json

                  {
                    "name": "myApp",
                    "private": "true",
                    "devDependencies": {
                      "ionic": "driftyco/ionic-bower#1.0.0-beta.13"
                    }
                  }
                  

                  和我的 package.json:

                  and my package.json:

                  {
                    "name": "myapp",
                    "version": "1.0.0",
                    "description": "myApp: An Ionic project",
                    "dependencies": {
                      "gulp": "^3.5.6",
                      "gulp-sass": "^0.7.1",
                      "gulp-concat": "^2.2.0",
                      "gulp-minify-css": "^0.3.0",
                      "gulp-rename": "^1.2.0"
                    },
                    "devDependencies": {
                      "bower": "^1.3.3",
                      "gulp-util": "^2.2.14",
                      "shelljs": "^0.3.0"
                    }
                  }
                  

                  推薦答案

                  如果有人嘗試在瀏覽器中運行它時仍然出現錯誤,請嘗試以下方法:

                  If someone still got an error when trying to run it in a browser, try this one:

                  if (window.cordova) {
                        db = $cordovaSQLite.openDB({ name: "my.db" }); //device
                      }else{
                        db = window.openDatabase("my.db", '1', 'my', 1024 * 1024 * 100); // browser
                      }
                  

                  這篇關于如何在 Ionic 框架中使用 ngCordova s??qlite 服務和 Cordova-SQLitePlugin?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Update Record in Sqlite Window Phone 8(Sqlite Window Phone 8 中的更新記錄)
                  Build SQLite for windows phone 8(為 Windows Phone 8 構建 SQLite)
                  SQLite 3.8.2 exception on Update statement(更新語句上的 SQLite 3.8.2 異常)
                  How to create database and table in sqlite programatically using monotouch?(如何使用monotouch以編程方式在sqlite中創建數據庫和表?)
                  Xamarin SQLite quot;This is the #39;bait#39;quot;(Xamarin SQLite“這是‘誘餌’)
                  Angular Error - ReferenceError: $modal is not defined(角度錯誤 - ReferenceError: $modal 未定義)
                • <tfoot id='TVoOP'></tfoot>

                      <legend id='TVoOP'><style id='TVoOP'><dir id='TVoOP'><q id='TVoOP'></q></dir></style></legend>

                      <small id='TVoOP'></small><noframes id='TVoOP'>

                      • <bdo id='TVoOP'></bdo><ul id='TVoOP'></ul>

                            <tbody id='TVoOP'></tbody>
                            <i id='TVoOP'><tr id='TVoOP'><dt id='TVoOP'><q id='TVoOP'><span id='TVoOP'><b id='TVoOP'><form id='TVoOP'><ins id='TVoOP'></ins><ul id='TVoOP'></ul><sub id='TVoOP'></sub></form><legend id='TVoOP'></legend><bdo id='TVoOP'><pre id='TVoOP'><center id='TVoOP'></center></pre></bdo></b><th id='TVoOP'></th></span></q></dt></tr></i><div class="ig0e2sg" id='TVoOP'><tfoot id='TVoOP'></tfoot><dl id='TVoOP'><fieldset id='TVoOP'></fieldset></dl></div>
                            主站蜘蛛池模板: 武汉天安盾电子设备有限公司 - 安盾安检,武汉安检门,武汉安检机,武汉金属探测器,武汉测温安检门,武汉X光行李安检机,武汉防爆罐,武汉车底安全检查,武汉液体探测仪,武汉安检防爆设备 | 强效碱性清洗剂-实验室中性清洗剂-食品级高纯氮气发生器-上海润榕科学器材有限公司 | 储气罐,真空罐,缓冲罐,隔膜气压罐厂家批发价格,空压机储气罐规格型号-上海申容压力容器集团有限公司 | YT保温材料_YT无机保温砂浆_外墙保温材料_南阳银通节能建材高新技术开发有限公司 | 河南彩印编织袋,郑州饲料编织袋定制,肥料编织袋加工厂-盛军塑业 河南凯邦机械制造有限公司 | 温州中研白癜风专科_温州治疗白癜风_温州治疗白癜风医院哪家好_温州哪里治疗白癜风 | 运动木地板_体育木地板_篮球馆木地板_舞台木地板-实木运动地板厂家 | 蓝莓施肥机,智能施肥机,自动施肥机,水肥一体化项目,水肥一体机厂家,小型施肥机,圣大节水,滴灌施工方案,山东圣大节水科技有限公司官网17864474793 | 正压密封性测试仪-静态发色仪-导丝头柔软性测试仪-济南恒品机电技术有限公司 | 火锅底料批发-串串香技术培训[川禾川调官网] | 日本SMC气缸接头-速度控制阀-日本三菱伺服电机-苏州禾力自动化科技有限公司 | 宜兴紫砂壶知识分享 - 宜兴壶人 医用空气消毒机-医用管路消毒机-工作服消毒柜-成都三康王 | 泰安办公家具-泰安派格办公用品有限公司 | 浙江宝泉阀门有限公司 | [品牌官网]贵州遵义双宁口腔连锁_贵州遵义牙科医院哪家好_种植牙_牙齿矫正_原华美口腔 | 山东彩钢板房,山东彩钢活动房,临沂彩钢房-临沂市贵通钢结构工程有限公司 | 电加热导热油炉-空气加热器-导热油加热器-翅片电加热管-科安达机械 | 【官网】博莱特空压机,永磁变频空压机,螺杆空压机-欧能优 | 新密高铝耐火砖,轻质保温砖价格,浇注料厂家直销-郑州荣盛窑炉耐火材料有限公司 | 北京模型公司-工业模型-地产模型-施工模型-北京渝峰时代沙盘模型制作公司 | 手持式3d激光扫描仪-便携式三维立体扫描仪-北京福禄克斯 | 超声波电磁流量计-液位计-孔板流量计-料位计-江苏信仪自动化仪表有限公司 | 卸料器-卸灰阀-卸料阀-瑞安市天蓝环保设备有限公司 | 盛源真空泵|空压机-浙江盛源空压机制造有限公司-【盛源官网】 | 12cr1mov无缝钢管切割-15crmog无缝钢管切割-40cr无缝钢管切割-42crmo无缝钢管切割-Q345B无缝钢管切割-45#无缝钢管切割 - 聊城宽达钢管有限公司 | 至顶网| TPE塑胶原料-PPA|杜邦pom工程塑料、PPSU|PCTG材料、PC/PBT价格-悦诚塑胶 | 无压烧结银_有压烧结银_导电银胶_导电油墨_导电胶-善仁(浙江)新材料 | 12cr1mov无缝钢管切割-15crmog无缝钢管切割-40cr无缝钢管切割-42crmo无缝钢管切割-Q345B无缝钢管切割-45#无缝钢管切割 - 聊城宽达钢管有限公司 | 水性漆|墙面漆|木器家具漆|水漆涂料_晨阳水漆官网 | 整车VOC采样环境舱-甲醛VOC预处理舱-多舱法VOC检测环境仓-上海科绿特科技仪器有限公司 | HDPE储罐_厂家-山东九州阿丽贝防腐设备| 东莞韩创-专业绝缘骨架|马达塑胶零件|塑胶电机配件|塑封电机骨架厂家 | 口臭的治疗方法,口臭怎么办,怎么除口臭,口臭的原因-口臭治疗网 | 北京印刷厂_北京印刷_北京印刷公司_北京印刷厂家_北京东爵盛世印刷有限公司 | 耙式干燥机_真空耙式干燥机厂家-无锡鹏茂化工装备有限公司 | 拉曼光谱仪_便携式|激光|显微共焦拉曼光谱仪-北京卓立汉光仪器有限公司 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 浇注料-高铝砖耐火砖-郑州凯瑞得窑炉耐火材料有限公司 | 厌氧工作站-通用型厌氧工作站-上海胜秋科学仪器有限公司 | 二手电脑回收_二手打印机回收_二手复印机回_硒鼓墨盒回收-广州益美二手电脑回收公司 |