retain angular variables after page refresh

前端 未结 5 1200
一个人的身影
一个人的身影 2020-12-03 17:01

I\'m trying to figure out a way to keep my angular variables with page refresh / across controllers. My workflow is,

  • user logs in via facebook an
5条回答
  •  心在旅途
    2020-12-03 17:45

    When you refresh a page all your JavaScript context is lost (including all data saved in variables).

    One way to maintaing information from one session to another is to use the browser's localStorage. In your case, you probably want to check ngStorage.

提交回复
热议问题