Skip to content

Instantly share code, notes, and snippets.

@alnutile
Created March 20, 2014 20:37
Show Gist options
  • Select an option

  • Save alnutile/9673298 to your computer and use it in GitHub Desktop.

Select an option

Save alnutile/9673298 to your computer and use it in GitHub Desktop.
Angular and watching a filter
<tbody>
<tr ng-repeat="report in (reportsFiltered = ( reports | filter:{status:passFailShow} | filter:{site_id:siteFilter} | filter:tagged | filter:dateRangeCheck | filter:search))" ng-class="{danger: report.status == 0}">
<td ng-bind-html="report.status | passFailFilter "></td>
<td>{{ report.created }}</td>
<td>{{ report.test_name }}</td>
<td><span ng-repeat="tag in report.tags"> {{tag}} </span></td>
<td>{{ report.user_id }}</td>
<td><a href="#/reports/{{ report.rid }}">drill down</a></td>
</tr>
</tbody>
</table>
$scope.$watch('reportsFiltered', function(){
//do something with the data
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment