<commit_before># Angular JS

### Page by ajax

    :::html
    <html ng-app="phonecatApp">
    <head>
    <script type="text/javascript" src="http://cdn.staticfile.org/angular.js/1.2.0rc3/angular.min.js"></script>
    <script type="text/javascript">
    var phonecatApp = angular.module('phonecatApp', []);
    phonecatApp.controller('TablePagerCtrl', function($scope, $http) {
        $scope.name = "Pageration by http.get";
        $scope.page_no = 0;
        $http.get('/table/next?page_no=' + $scope.page_no).success(function(data) {
            $scope.rows = data.data;
            $scope.page_no++;
        })
        $scope.getNext = function(page_no) {
            if(page_no < 1) {
                page_no = 1;
            }
            $http.get('/table/next?page_no=' + page_no).success(function(data) {
                $scope.rows = data.data;
                $scope.page_no = page_no + 1;
            })
        }
        $scope.getPrev = function(page_no) {
            if(page_no < 2) {
                page_no = 2;
            }
            $http.get('/table/prev?page_no=' + page_no).success(function(data) {
                $scope.rows = data.data;
                $scope.page_no = page_no - 1;
            })
        }
    });
    </script>
    </head>
    <body>
    <div class="row" ng-controller="TablePagerCtrl">
        <div class="col-md-12">
            <legend>{{name}}</legend>
            <table class="table table-bordered">
                <thead>
                    <th>基数</th>
                    <th>阶乘</th>
                </thead>
                <tbody>
                    <tr ng-repeat="row in rows">
                        <td>{{row.index}}</td>
                        <td>{{row.data}}</td>
                    </tr>
                </tbody>
            </table>
            <button class="btn btn-default" ng-click="getPrev(page_no)">Prev</button>
            <button class="btn btn-default" ng-click="getNext(page_no)">Next</button>
        </div>
    </div>
    </body>
    </html><commit_msg>update node.md<commit_after># Angular JS

### Page by ajax

HTML 代码

    <html ng-app="phonecatApp">
    <head>
    <script type="text/javascript" src="http://cdn.staticfile.org/angular.js/1.2.0rc3/angular.min.js"></script>
    </head>
    <body>
    <div class="row" ng-controller="TablePagerCtrl">
        <div class="col-md-12">
            <legend>{{name}}</legend>
            <table class="table table-bordered">
                <thead>
                    <th>基数</th>
                    <th>阶乘</th>
                </thead>
                <tbody>
                    <tr ng-repeat="row in rows">
                        <td>{{row.index}}</td>
                        <td>{{row.data}}</td>
                    </tr>
                </tbody>
            </table>
            <button class="btn btn-default" ng-click="getPrev(page_no)">Prev</button>
            <button class="btn btn-default" ng-click="getNext(page_no)">Next</button>
        </div>
    </div>
    </body>
    </html>

JS 代码

    var phonecatApp = angular.module('phonecatApp', []);
    phonecatApp.controller('TablePagerCtrl', function($scope, $http) {
        $scope.name = "Pageration by http.get";
        $scope.page_no = 0;
        $http.get('/table/next?page_no=' + $scope.page_no).success(function(data) {
            $scope.rows = data.data;
            $scope.page_no++;
        })
        $scope.getNext = function(page_no) {
            if(page_no < 1) {
                page_no = 1;
            }
            $http.get('/table/next?page_no=' + page_no).success(function(data) {
                $scope.rows = data.data;
                $scope.page_no = page_no + 1;
            })
        }
        $scope.getPrev = function(page_no) {
            if(page_no < 2) {
                page_no = 2;
            }
            $http.get('/table/prev?page_no=' + page_no).success(function(data) {
                $scope.rows = data.data;
                $scope.page_no = page_no - 1;
            })
        }
    });

{'fraction_non_alphanumeric': 0.1613382899628253, 'fraction_numerical': 0.00644361833952912, 'mean_word_length': 1.4836923076923076, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 73, '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': '7011157', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1247, 'n_words': 192}