1

Fiddle

I got a table built with ng-repeat. I'd like to apply a | filter on it. It seems to work, however the filtered row isn't the good one.

For example :

If you type differed on the search bar , you will get

DIFFERED 1

while

DIFFERED has 5 as value.

How can I solve it ?

Note that I would like to keep this table structure and not having all the headers horizontally.

2 Answers 2

1

The problem is that filtering will reduce your list, so your $index will be always zero, thus accesing the list with parameter_list[$index] will return you the first item.

You should <input type="text" ng-model="parameter.value" class="form-control"> instead

Using parameter you will access the correct item of your filtered list

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

Comments

1

Use parameter.value instead of parameter_list[$index].value.

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.