Ng-repeat filter from config

Hey There,
I’d like to do some filtering on a ng-repeat item list. The following two use-cases do work when hardcoding the filter but dont when using a config item for them.

  1. Loop through all gRollershutters (set in config for groupID) where name starts with gf_ (for groundfloor)
<tr ng-repeat="item in itemsInGroup(config.groupID) | filter:{name: 'gf_'}">
  1. Loop through all gGf (set in config for groupID) where item is a Rollershutter.
<tr ng-repeat="item in itemsInGroup(config.groupID) | filter:{type: 'Rollershutter'}">

The above works, but as soon as I try to set the filter to config item to be more flexible, it breaks.
Not working:

<tr ng-repeat="item in itemsInGroup(config.groupID) | filter:{name: "{config.filter_scope1}"}">
<tr ng-repeat="item in itemsInGroup(config.groupID) | filter:{type: "{config.filter_scope2}"}">

Anyone got config based filters to work correctly? Thanks for your help!
Best Sebastian

PS: Would be cool if itemsInGroup would support nesting (group in group) like getAllMembers in rules.

1 Like

For the time being I’ve worked around the issue myself.
I’m looping over the whole group and do ng-if within the loop to only display items matiching the filter pattern.
Its a bit of resource overhead, to process items that are not neede, but should be fine.

In case someone has a more elegant solution, please let me know.
Thanks