0

Do I need to create a custom filter in AngularJS to filter the elements in a ng-repeat by object property?

For instance, my JSON gives as a response:

artist: "Limp Bizkit"
id: 433390
main_release: 2518780
resource_url: "http://api.discogs.com/masters/433390"
role: "Main"
thumb: "http://api.discogs.com/image/R-150-2518780-1288430478.jpeg"
title: "Counterfeit"
type: "master"
year: 1997

I want to have a checkbox that will filter by "role", so I thought about something like the ng-model of every checkbox defining as true or false statements like this:

filter:{ role: \'main\' } filter:{ role: \'remix\' } filter:{ role: \'trackappeared\' }

Am I thinking in the right direction?

1 Answer 1

0

Definetly creating a custom filter should be the way to go.

Here's an answer to a similar question (possible duplicate):

Filtering by multiple checkboxes in AngularJS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.