0

I have a JSON object in the following format:

{
   filters: [
        {Name: "pork",
         Active: true},
        {Name: "beef",
         Active: true},
        {Name: "chicken",
         Active: false}
   ]
}

I am constructing a SELECT list with the following:

ng-options="item.Name for item in filters"

I want to only construct an option if the "Active" key is true. Is there a way for me to do this in the psuedo-JavasScript inside of the Angular directive?

1 Answer 1

1

Try ng-options="item.Name for item in filters | filter:{ Active : true }".

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.