1

I am trying to filter an ng-repeat using a variable.

ng-repeat="data in datas | filter:{type:@{{someType}}}"

I am using blade template which explains the @. When I hard code the type value I want to filter it works. Not with the variable though.

What am I missing?

Thanks!

0

1 Answer 1

3

edit (I though you wanted someType to be rendered by blade):

You don't need to interpolate your argument in a filter. Simply do the following :

 ng-repeat="data in datas | filter:{type:someType}"
Sign up to request clarification or add additional context in comments.

1 Comment

Right. Perhaps I needed to be clearer. someType is a variable from another data element (not the one being used for the ng-repeat). So I need to use the @ so blade will ignore. But as you point out - not required within the argument. Thanks!!

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.