Answer the question
In order to leave comments, you need to log in
Why is there an error in cordova-plugin-nativestorage with nativeStorage.setItem?
Installed the cordova-plugin-nativestorage plugin, in app.module.ts
import { NativeStorage } from '@ionic-native/native-storage/ngx';
@NgModule({
providers: [
NativeStorage
]
})
constructor(private nativeStorage: NativeStorage){
this.nativeStorage.setItem('myitem', 123)
.then(
() => console.log('Stored item!'),
error => console.error('Error storing item', error)
);
this.nativeStorage.getItem('myitem')
.then(
data => console.log(data),
error => console.error(error)
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question