Comments (3)
Is your strorage created yet? That is an async function that takes some time. This doesn't seem like a bug to me, just the way it works.
I had some issues with it, because I used the storage indirecty in my auth-guard (via my auth-service), which is needed almost immediately.
I solved it by initializing the storage-service in a provider:
In app.module.ts:
import { APP_INITIALIZER } from '@angular/core';
export function appInitializer(storageService: StorageService) {
return () => storageService.init();
}
Add this to the providers:
{
provide: APP_INITIALIZER,
useFactory: appInitializer,
multi: true,
deps: [StorageService]
}
You don't need to call this.init() in your storage constructor anymore.
I'm not sure if this is the best solution, but at least the entire app waits until the storage is created.
from ionic-storage.
I think you're encountering this: #229
from ionic-storage.
yes, that looks like the same issue. Totally missed that, thank you.
from ionic-storage.
Related Issues (20)
- storage.get() behaviour HOT 1
- Behaviour when item doesnt exist in database
- Need help configuring the storage manager
- (question) rationale behind IndexedDB being the 1st driver in driversOrder ?
- The NgModule 'IonicStorageModule' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.
- IOS app doesn't retain state after ionic/storage version(3.0.6) upgrade for ionic app HOT 1
- Not working when re opening the app in OFFLINE mode HOT 1
- Angular 15 updates in source code not available in npm HOT 5
- Angular 16 support HOT 22
- iOS 16.1 SDK update clears ionic storage HOT 2
- Unable to use SQLite for native storage (Android) but only IndexDB and localstorage works ,Error: No available storage method found HOT 2
- Error: No available storage method found when using CordovaSQLiteDriver with Ionic Storage HOT 1
- SQLite Installation HOT 1
- localForage-CordovaSQLiteDriver maintenance
- Storage access blocks the main ui HOT 2
- ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[AuthGuard -> StorageService -> Storage -> Storage]: NullInjectorError: No provider for Storage! HOT 2
- Angular 16 upgrading HOT 3
- Random data losses on iOS HOT 4
- Update README for Angular users HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-storage.