I'm trying to change which property I'm filtering by assigning the property name to a variable, but it's not working. Is there a way to accomplish this without writing my own filter? codepen
<div ng-app="app" ng-controller="main as m">
<input ng-model="keyword"/>
<p>Property: {{m.property}}</p> <!-- resolves to 'name' -->
<!-- does not work-->
<div ng-repeat="o in m.objects | filter:{m.property:keyword}">
{{o.name}}
</div>
<hr/>
<!-- works-->
<div ng-repeat="o in m.objects | filter:{name:keyword}">
{{o.name}}
</div>
</div>