gpt4 book ai didi

sqlite - SQLiteObject ionic 3 的插入提供程序

转载 作者:行者123 更新时间:2023-12-03 19:25:30 25 4
gpt4 key购买 nike

我正在做一个关于 ionic 3 angular 4 的项目。我必须连接到数据库并做其他事情......
所以我有一个页面(.ts .html .scss .module.ts),一个我使用 sql 的提供程序。所以我的问题是这样的,我有这个错误:

核心.es5.js:1084
ERROR 错误:未捕获( promise ):错误:没有 SQLiteObject 的提供者!
错误:没有 SQLiteObject 的提供者!


所以在module.ts中我添加了provider flag我把SQLiteObject。但现在我得到了这个新错误:

compiler.es5.js:1540 未捕获错误:无法解析 SQLiteObject 的所有参数:(?)。

另外,如果我放 SQLite,它总是需要 SQLiteObject 提供程序。无论如何,我从不使用 SQLite,只使用 SQLiteObject

import { SQLiteObject } from '@ionic-native/sqlite';

我谷歌,我发现 SQLiteObject 不是提供者,而只是一个接口(interface)。

所以?任何的想法?我可以放代码,但是很长,如果您有什么想法,请发表评论。

最佳答案

您需要将其类添加到 app.module.ts 文件中的提供程序中,如下所示:

import { SQLiteObject } from '@ionic-native/sqlite';

@NgModule({
declarations: [
MyApp
],
imports: [
//
],
bootstrap: [IonicApp],
entryComponents: [
MyApp
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}, SQLiteObject]
})

export class AppModule {}

关于sqlite - SQLiteObject ionic 3 的插入提供程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44286023/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com