Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
That is, if I receive some data from the server, with which I then have to work in different variations, then in order not to load this data from the server each time, can I use only localstorage?
For example, I have two lists that depend on one another (industry and category, several categories can belong to one industry). Initially, I receive json with an array of two objects: 1. industries 2. categories (each has a property - which industry it belongs to)
Further, for example, if I choose an industry, then only those that belong to this industry should remain in the list of categories. That is, I get the id of the industry and run through the array of categories, check if there is a binding to the industry, then I put the category in the $scope.tmpArray array is valid. Next $scope.category = $scope.tmpArray;
This leads to the result that is needed, the categories are updated in the list, the extra ones are filtered. And in this case, I must first save $scope.category somehow (in localstorage?), Or at the next choice, request the full data from the server again in order to perform the entire filtering procedure. I don't understand how to do it right.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question