Retain page data on refreshing the page

前端 未结 4 914
猫巷女王i
猫巷女王i 2020-12-18 21:20

I am new to angular. I am using a service which gets a list of objects and displays them on the 1st page. Then based on what object was clicked, I am setting the tab header

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 22:04

    Do you have several angularjs apps? In theory you should have a single HTML file and partials / controllers, you can store the data you want to use in a factory (singleton) or angularJS cache, if you are going to navigate between several HTML pages you can use local storage or reload the data from server.

    Some useful links:

    $cache

    https://docs.angularjs.org/api/ng/service/$cacheFactory

    Local storage:

    How do I store data in local storage using Angularjs?

提交回复
热议问题