Hello,

I'm working on a multi-page e-commerce platform and decided to use Angular 
for the frontend. (the backend is PHP)
Here is a screenshot of what I'm trying to achieve: 
http://i.imgur.com/hRvOgz5.png

I have several issues:

   1. I made a list of checkboxes, all binded to an object. Then I watched 
   for changes and joined the "keys" of all active ones. The reason for this 
   is that I want nice URLs like this: 
   http://site.com/search?manufacturer=dell,lenovo. The issue here is that I 
   can't specify which checkboxes should be checked from the beginning. In PHP 
   I parse the query string and display the products accordingly. Also from 
   PHP I add the "checked" attribute but ng-model overwrites this. (Here is 
   the implementation http://plnkr.co/edit/ctHmNVna4J2ViHcrPruz?p=preview)
   2. A solution for the previous issue would be to parse the query string 
   from javascript and update the models. The issue here is that I don't know 
   how to structure this properly. Keep in mind that I have multiple filters 
   like this on each page, and each category has a different group of filters. 
   I thought of mapping a controller for each category and a factory for each 
   filter. Is this a good practice?
   3. I have some more complex filters like price where I have a list of 
   checkboxes and also 2 text inputs to specify the lower and upper limits for 
   the price. If I had a list of models each containing lower, upper and label 
   I could do ng-repeat and display them properly and this would work for the 
   text inputs too. The issue here is I have the values embedded in HTML then 
   I need to parse them, which I think is not a good Angular practice. Would 
   be ok to get the data using $http requests? If it is ok to do this, where 
   to parse the state of the checkboxes, in PHP or in Angular?
   4. How to deal with facets numbers. If a user checks an item the search 
   results will be narrower and the numbers in parentheses after each item 
   should be updated accordingly. I think this should be done in server side 
   because the client side doesn't have knowledge of all products.

Having in mind the previous issues, the main question is how much do to on 
the server side and how much to do on the client side?
Also, what is the best practice to do the client side part in Angular?

Thank you,
Andrew

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to