Ionic 2 has a Native Storage component for iOS and Android: https://ionicframework.com/docs/v2/native/nativestorage/
In the repo's readme (https://github.com/TheCocoaProject/cordova-plugin-nativestorage) is said that there is support for browser environment (it uses the LocalStorage fom the browser).
I tried to use it but when I run my Ionic in browser (ionic serve) the browser outputs something like this:
main.js:224 Native: tried calling NativeStorage.setItem, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
In the browser environment the cordova is not injected. This makes senses, as long as the cordova.js only works for integration with the device's API.
Anyone knows if it is possible to use this plugin in the browser?
ionic run browserinstead ofionic serve browser? When run is used the cordova.js and any plugins will be injected. So it is possible to use this plugin in the browser, but not with serve. Because with serve the app runs only as a webpage. - gillesC