Ionic2 Error: “No provider for Storage”

前端 未结 4 732
孤独总比滥情好
孤独总比滥情好 2020-12-29 23:14

After reading everything I could find, and failing, I must ask here:

I am trying to use ionic2\'s Storage, just like the doc tells me to,

doc: https://ionicf

4条回答
  •  感动是毒
    2020-12-29 23:45

    Firstly you need to install: npm install --save @ionic/storage

    The problem was in app.ts:

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

    Capital 'S' instead of non capital 's':

    from '@ionic/Storage'
    

    instead of:

    from '@ionic/storage'
    

    No idea why the compiler wouldn't catch that if it's a problem, but it didn't.

    Thanks to @chairmanmow

提交回复
热议问题