ionic3使用Storage报错

1、错误信息

原因:没有在AppModule导入IonicStorageModule

import { IonicStorageModule } from '@ionic/storage';

@NgModule({
  declarations: [
    // ...
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot()
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    // ...
  ],
  providers: [
    // ...
  ]
})
export class AppModule {}

猜你喜欢

转载自blog.csdn.net/ligaoming_123/article/details/82381678