Keep dropdown values when go back and forth in my views - using localStorage

168 views
Skip to first unread message

Syrrah

unread,
Apr 12, 2021, 12:56:22 AM4/12/21
to Angular and AngularJS discussion

I have this project, with VB for backend and AngularJS for the frontend. 1 of the issues i am tasked to fix is a dropdown that doesn't keep it's values after i change page and then go back to said page.

In more detail:

  • i have a list coming from the backend - VB, with all the data i need, which said list i use for the dropdown
  • i have a view that has a 4 dropdowns to apply filters to the page .
  • i apply a filter or a combination of filters to see only the desired applications.
  • i click on an application and therefore i am redirected to the page of said application.
  • i do all i have to do there and so i click the browser back button to go to the list of all the applications.
  • the filters are lost and i need to still have them active.
  • List item

what i have done so far:

  • i bind the value of each dropdown (each filter to be exact) in localStorage 
  • the localStorage values change along with the dropdowns

What i need is to have the values of localStorage apply to said dropdown, so that each filter can still be applied when i go back to this page.

https://stackoverflow.com/questions/66981172/bind-value-to-dynamic-dropdown-from-localstorage-angularjs - for more details
Reply all
Reply to author
Forward
0 new messages