When working with Angular, it's possible to easily apply filters to format variables, like so:
{{ myDate | date }}
{{ myMoney | currency }}
But, is there a way to dynamically set the filter type in a more flexible manner as shown below?
// controller
$scope.myFilter = 'date';
// view
{{ myVar | myFilter }}
Situation: I am retrieving tabular data from my server along with metadata. I aim to display information such as dates, money, or numbers without manually specifying the columns.
For a simple illustration of this issue, check out this non-functional Plunker demo: http://plnkr.co/edit/SjYLKKUZcTjzRFhbsjK0