JSFiddle - React, Tailwind, and code Playground

by Valentin Sarychev

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.js"></script>
<script type="text/ng-template" id="tree-grid-template.html">
    <td ng-repeat="col in colDefinitions" >
        {{row.branch[col.field] | custom : treeGridTest.filterArray[col.field]}}
    </td>
</script>

JavaScript

var module = angular.module('treeGrid',[]);
  module.directive('treeGrid', [
    '$timeout', function($timeout) {
      return {
        restrict: 'E',
        templateUrl:'tree-grid-template.html',
        replace: true,
        scope: {
          treeData: '=',
          colDefs:'=',
          expandOn:'=',
          onSelect: '&',
          initialSelection: '@',
          treeControl: '='
        },
        link: function(scope, element, attrs) {
        /* Some code */
      };
    }
  ]);
        
        var app = angular.module('treeGridTest', ['treeGrid']);

app.controller('treeGridController', function($scope) {

    $scope.filterArray = {
         'Sales': 'currency',
         'Profit': 'currency',
         'Area' : 'lowercase'
     };
});

app.filter('custom', ['$filter', function (segmentio) {
    return function (value, type) {
        return segmentio(type)(value);
    }
}]);