Runtime Error : Unexpected value 'Storage' imported by the module 'AppModule'


#1

Getting error with ionic serve chrome.

Runtime Error: Unexpected value 'Storage' imported by the module 'AppModule'. Please add a @NgModule annotation.

Doing import in app.module.ts
import { Storage } from '@ionic/storage';

Platform Details are:

Ionic Framework: 3.2.1
Ionic App Scripts: 1.3.7
Angular Core: 4.1.0
Angular Compiler CLI: 4.1.0
Node: 7.5.0
OS Platform: Linux 4.4
Navigator Platform: Linux x86_64
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

#2

I was doing wrong, got a fix.

In app.module.ts need to import
import { IonicStorageModule } from '@ionic/storage';

than can use in component ( app.component.ts):
import { Storage } from '@ionic/storage';

reference https://github.com/driftyco/ionic-storage