mercredi 23 septembre 2015

AngularJS custom filters with ng-repeat (range and multiple-checkboxes)

Im trying to build a app with AngularJS but im struggeling alot with it.

How this app should work / what it should do:

  • Get data from a URL (JSON)
  • Display data
  • Filter the data with custom filters

Types of filters I need / want:

  • Fieldset with multiple checkboxes (would be awesome if the checkboxes would be dynamic with the values from JSON)
  • Input fields for a range (min-max value | both sided)

My JSON looks like:

{"status":"ok","products":[{"a_min":"30","a_max":"50","slug":["one","two"]},{"a_min":"123","a_max":"2222","slug":["one"]},{"a_min":"10","a_max":"300","slug":["two","three"]}]}

I dont have much clue about AngularJS, the documentation didnt help me alot. Would be awesome to get hints / explanations first.

Here is my FIDDLE.

Questions:

  • Whats the best way to manage multiple checkboxes?
  • How can I use AngularJS to makae the checkboxes dynamic to the content?

Thanks for any help!




Aucun commentaire:

Enregistrer un commentaire