We have a table generated from a generic structure with filtering allowed on the columns. The structure can include a regex value for ensuring the user enters only valid filtering values. We want to apply the regex in the normal ng-pattern way with a validation message ... something like this
<table class="table header">
<thead ng-form="columnFiltersForm">
<tr>
<th class="col-{{$index}}"
ng-repeat="column in columns track by column.Name">
<div>
<span>{{column.DisplayName}}</span>
</div>
<input type="text" class="filter form-control"
name="col-{{$index}}" ng-model="column.filterVal"
placeholder="Search" ng-pattern="column.FilterRegex" />
<div ng-messages="columnFiltersForm.col-{{$index}}.$error"
class="validation" role="alert">
<span ng-message="pattern">
Invalid character for {{column.DisplayName}}
</span>
</div>
</th>
</tr>
</thead>
</table>
However, the ng-messages value of columnFiltersForm.col-{{$index}}.$error
doesn't work. Any idea if something like this is possible, and how to achieve it?