Using Spring 4 and angularjs, I am developing a web application which has the following functionality:
home.html
- User inputs product search criteria and submits search
results.html
- The application displays a list of products (within DIV elements) that meets the criteria as returned from the server.
- For each product, the user can click a "Select" button, or a "Dismiss" button which removes it from the DOM. The "Select" simply adds the product ID to a Javascript array
- The user can Submit the selection which posts the array of selected products to the server.
- Also before submission, the user can click a product and thereby navigate to a product.html page which displays further details.
product.html, home.html and results.html are loaded into an ng-view contained in index.html
All this is pretty standard funtionality and it is working for me OK. However, when the user is viewing the product.html page, I need a link back to results.html page that includes (1) the results of the criteria, and (2) any modifications the user had made such as clicking the Submit or Dismiss buttons. Basically, it should be exactly like as if the user opened product.html in a new browser tab and then closed it to return to the results, but instead it is all happening within a ng-view.
My instinct is that this is basically a typical "cart" with the search results being the cart contents. However, I'm unsure if I am correct with this assumption. Also, I'm unsure how to implement this functionality using Spring and angularjs - should this functionality be managed by Spring, angularjs or both.
I'm not looking for the exact code here, but rather a point in the correct direction as to what approach to use to implement this. Thanks.