Hi, I am new to ionic 2. I am working with ionic version 2.2.1. I want to use sqllite to store my login state.
I followed this (https://ionicframework.com/docs/v2/storage/). But after doing this my app is not working.
when I run ionic serve it will give below error
[23:06:26] build started …
[23:06:26] transpile started …
[23:06:33] typescript: G:/Mobile Project/xxx/src/app/app.module.ts, lin
e: 3
Module ‘“G:/Mobile Project/yowunpuraya/node_modules/@ionic/storage/e
s2015/index”’ has no exported member
’IonicStorageModule’.
L2: import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angu
lar’;
L3: import { IonicStorageModule } from ‘@ionic/storage’;
L4: import { MyApp } from ‘./app.component’;
[23:06:33] transpile failed
[23:06:33] build finished in 7.10 s
No you still use { IonicStorage } in pages and providers. but you must change the on in app.module.ts to { IonicStorageModule } and add IonicStorageModule.forRoot() to the imports array in app.module.ts instead of where it was which was the constructor or the providers.
He is right. I use Storage while in the pages and providers. The other part is what has changed. Good call. I was going through it fast and didn’t notice that I put { IonicStorage } instead of { Storage }