Error: No provider for Storage!


#1

Hi all, I’m following the rc1 instructions for Storage and getting this error:

main.js:3427 Error: No provider for Storage!

I have Storage defined in app.module.ts and importing it where I’m using it. Both Storage versions 1.0.3 and 1.1.6 are giving the same problem.

Your system information:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.36
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X Sierra
Node Version: v5.12.0
Xcode version: Xcode 8.0 Build version 8A218a

Thanks, shawn.


Where is Storage and LocalStorage in rc0?
Where is Storage and LocalStorage in rc0?
#2

rc0 Storage isn’t working for me (see my post) so I’m using localForage, which is what Storage uses anyway. Usage is simple:

Add it to package.json:

"localforage": "1.4.3",

Import it in your Typescript file:

import localForage from "localforage";

And use it:

localForage.setItem(this.STORE_EMAIL_KEY, loginInfo.email);