JSFiddle - React, Tailwind, and code Playground
by Steve Ayers
HTML
<div ng-app="MyApp">
<div ng-controller="MyCtrl as myCtrl">
<button ng-click="myCtrl.run()">Filter!</button>
</div>
</div>
JavaScript
angular.module("MyApp", []).filter('filterByCategory', function () {
return function (input, trees) {
console.log(input, trees);
// rest of your filter
};
}).controller("MyCtrl", function ($filter) {
this.run = function () {
$filter('filterByCategory')('input', ['trees']);
}
});