I try to use this in my Ionic 2 application : https://ionicframework.com/docs/v2/storage/
I already run
cordova plugin add cordova-sqlite-storage --save
and
npm install --save @ionic/storage
Successfully.
And when I tried to add Storage in my app.module.ts, I had this error :
Error: Can't resolve all parameters for Storage: (?).
at v (http://localhost:8100/build/polyfills.js:3:4864)
at SyntaxError.BaseError [as constructor] (http://localhost:8100/build/main.js:127193:27)
at new SyntaxError (http://localhost:8100/build/main.js:11660:16)
at CompileMetadataResolver._getDependenciesMetadata (http://localhost:8100/build/main.js:27183:31)
at CompileMetadataResolver._getTypeMetadata (http://localhost:8100/build/main.js:27058:26)
at CompileMetadataResolver._getInjectableMetadata (http://localhost:8100/build/main.js:27046:21)
at CompileMetadataResolver.getProviderMetadata (http://localhost:8100/build/main.js:27288:40)
at http://localhost:8100/build/main.js:27246:49
at Array.forEach (native)
at CompileMetadataResolver._getProvidersMetadata (http://localhost:8100/build/main.js:27213:19)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/main.js:26897:50)
at JitCompiler._loadModules (http://localhost:8100/build/main.js:72991:64)
at JitCompiler._compileModuleAndComponents (http://localhost:8100/build/main.js:72951:52)
at JitCompiler.compileModuleAsync (http://localhost:8100/build/main.js:72917:21)
at PlatformRef_._bootstrapModuleWithZone (http://localhost:8100/build/main.js:52753:25)
I don't understand how I have to do to solve it.
My app.module.ts :
import { Storage } from '@ionic/storage';
...
providers: [
{provide: ErrorHandler, useClass: IonicErrorHandler},
PData,
PBackground,
PTranslate,
Storage
]
...