AngularJS : Custom filters and ng-repeat

前端 未结 4 1964

I\'m an AngularJS newbie and I\'m building up a small proof-of-concept car hire listings app that pulls in some JSON and renders out various bits of that data via an ng-repe

4条回答
  •  死守一世寂寞
    2020-11-27 11:42

    One of the easiest ways to fix this is to use the $ which is the search all.

    Here is a plunker that shows it working. I have changed the checkboxes to radio ( because I thought they should be complementary )..

    http://plnkr.co/edit/dHzvm6hR5P8G4wPuTxoi?p=preview

    If you want a very specific way of doing this ( instead of doing a generic search ) you need work with functions in the search.

    The documentation is here

    http://docs.angularjs.org/api/ng.filter:filter

提交回复
热议问题