Why Ionic Local Storage work with only promise!

Hi, I work with Ionic 4 and I have to implemented a login page. So I use Ionic Local Storage for save the token of the user and retrieve this token for the authentication. But if I use Ionic Locale Storage I retrieve my token but the code go ahead is not correct in the case of login…

1 Like

Lots of external sources you will encounter when writing Ionic apps will be asynchronous, so it’s worth taking the time to understand how they work and feel comfortable with integrating them into your code.

2 Likes

Yes but for a login and retrieve a cookie I have to use promise observable …is not possible for a simple but simple operation is not normal

I want to use local storage or session storage to save the authentication token in angular 2.0.0 … I use angular2-localstorage, but it only works with angular 2.0. 0-rc.5, and when I used it in 2.0.0, it went through me type. I want to use the default local storage Angular 2.0.0.