<commit_before>{% extends 'appbuilder/baselayout.html' %}

{% import 'appbuilder/general/lib.html' as lib %}

{% block head_js %}
{{ super() }}
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>

<script type="text/javascript">

var app = angular.module('myApp', []);

app.config(['$interpolateProvider', function($interpolateProvider) {
  $interpolateProvider.startSymbol('{[');
  $interpolateProvider.endSymbol(']}');
}]);

app.controller("TableCtrl", function($scope, $http) {

  $scope.filter = "";

  function ajaxGet() {
  $http.get('/contactmodelview2/api').
    success(function(data, status, headers, config) {
      $scope.data = data;
      console.log($scope.data.result);
    }).
    error(function(data, status, headers, config) {
      // log error
    });
    }
   ajaxGet();
});


</script>
{% endblock %}


{% block content %}
{{ super() }}

<input class=" filter_val form-control" id="name" name="_flt_0_name" placeholder="Name" type="text" value="">

<div  ng-app="myApp" class="table-responsive">
<div ng-controller="TableCtrl">
<table class="table table-bordered table-hover">
	<thead id="thead">
	</thead>
	<tbody id="tbody">
        <tr ng-repeat="row in data.result">
            <td ng-repeat="col in data.list_columns">{[row[col] ]}</td>
        </tr>
    </tbody>
</table>
</div>
</div>



{% endblock %}<commit_msg>AngularJS with FAB example<commit_after>{% extends 'appbuilder/baselayout.html' %}

{% import 'appbuilder/general/lib.html' as lib %}

{% block head_js %}
{{ super() }}
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>

<script type="text/javascript">

var app = angular.module('myApp', []);

app.config(['$interpolateProvider', function($interpolateProvider) {
  $interpolateProvider.startSymbol('{[');
  $interpolateProvider.endSymbol(']}');
}]);

app.controller("TableCtrl", function($scope, $http) {

  $scope.filter = "";
  $scope.order_column = "";
  $scope.order_direction = "";

  function ajaxGet() {
      if ($scope.filter == "" ) {
        var base_url = "/contactmodelview2/api";
      }
      else {
        var base_url = "/contactmodelview2/api?_flt_0_name=" + $scope.filter;
      }

      $http.get(base_url).
        success(function(data, status, headers, config) {
          $scope.data = data;
        }).
        error(function(data, status, headers, config) {
          // log error
        });
   }
   $scope.$watch('filter', function (value) {
        ajaxGet();
    });

    function orderClick(colName) {
        alert(colName);
    }

   ajaxGet();
});


</script>
{% endblock %}


{% block content %}
{{ super() }}

<div  ng-app="myApp" >
<div ng-controller="TableCtrl">

    <input class=" filter_val form-control" ng-model='filter' id="name" name="_flt_0_name" placeholder="Name" type="text" value="">

    <div class="table-responsive">
    <table class="table table-bordered table-hover">
        <thead id="thead">
        <tr><th ng-repeat="col in data.list_columns">
            <a href="#" ng-click="orderClick({[data.label_columns[col] ]})">{[data.label_columns[col] ]}</a>
        </th></tr>
        </thead>
        <tbody id="tbody">
            <tr ng-repeat="row in data.result">
                <td ng-repeat="col in data.list_columns">{[row[col] ]}</td>
            </tr>
        </tbody>
    </table>
    </div>
</div>
</div>


{% endblock %}
{'fraction_non_alphanumeric': 0.19824561403508772, 'fraction_numerical': 0.004093567251461989, 'mean_word_length': 3.2655860349127184, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6027476', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1129, 'n_words': 206}