"use strict";

var app = angular.module("hbase-dataflow-app");

app.directive('hbaseTable', function() {
  return {
    restrict: 'E',
    templateUrl: 'includes/hbase_table',
    scope: {
      table: "="
    },
    link: function(scope, elem, attrs) {
      // deep watch attrs.table
      scope.$watch(attrs.table, function(table) {
        if (table) {
          var rows = table.getRows();

          if (rows.length) {
            scope.columns = [];
            scope.rows = [];

            for (var i = 0; i < rows.length; i++) {
              var row = rows[i];
              var families = row.getColumns();
              var values = [];

              for (var j = 0; j < families.length; j++) {
                var family = families[j];
                var columns = family.getColumns();

                for (var k = 0; k < columns.length; k++) {
                  // copy a virtual variable
                  var column = angular.copy(columns[k]);

                  column.setName(family.getName() + ":" + column.getName());

                  scope.columns.push(column);

                  values.push(column.getValue());
                }
              }

              scope.rows.push({
                key: row.getKey(),
                values: values
              });
            }
          }
        }
      }, true);
    }
  };
});
@@ -321,32 +321,340 @@
 nction(table) %7B%0A
+        function isTheSameColumn(columns, column) %7B%0A          var found = false;%0A%0A          for (var i = 0; i %3C columns.length; i++) %7B%0A            if (columns%5Bi%5D.getName() === column.getName()) %7B%0A              found = true;%0A%0A              break;%0A            %7D%0A          %7D%0A%0A          return found;%0A        %7D%0A%0A
         if (tabl
@@ -1340,24 +1340,145 @@
 etName());%0A%0A
+                  var theSameColumn = isTheSameColumn(scope.columns, column);%0A%0A                  if (!theSameColumn) %7B%0A  
             
@@ -1502,32 +1502,52 @@
 ns.push(column);
+%0A                  %7D
 %0A%0A              

fix the same column issue