简体   繁体   中英

Ionic2 x Angular: Service resetting on nav change

Using Angular2 in Ionic2

Utilizing a userService to login and pull a user from the server, however on a nav change (or click of existing page in nav) it does a reload that is causing the service to reinitialize (I think) and emptying the user in the service.

How do I retain the user / user$ variable in the service as I navigate throughout the app?

不知道它是否是正确的处理方式,但是现在我正在利用存储并在重新启动时让userService检查存储。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM