mardi 5 juillet 2016

How to get list of checkboxes to behave like a dropdown with AngularJS

Dropdowns are fine to get a radio button behaviour and hide a long list... But I never liked them.. They require the user to click in order to see the list and their style don't match the page.

I would like to find a more dynamic way using angular.

How do I display a list of checkboxes and hide all unchecked checkboxes once a checkbox is checked? Unchecking the checkbox should then display all checkboxes again...

I tried the following, but without any luck.

<ul>
  <li ng-repeat="album in albums | filter: '' ">
   <input type="checkbox" ng-model="selected" ng-value="" />
   </li>
</ul>




Aucun commentaire:

Enregistrer un commentaire