<commit_before>'use strict';

angular.module('myApp', [
  'myApp.services',
	'ui.bootstrap',
	'ui.bootstrap.tpls',
  'ui.router'
])
.config(['$stateProvider', '$urlRouterProvider',
        function($stateProvider, $urlRouterProvider) {

  $stateProvider
    .state('index', {
      url: "/index",
      views: {
        "state" : { templateUrl: "index.html" }
      }
    })
    .state('list', {
      url: "/list",
      views: {
        "state" : { templateUrl: "partials/blog_list.html" }
      }
    })
    .state('content', {
      url: "/content",
      views: {
        "state" : { templateUrl: 'partials/content.html' }
      }
    })
    .state('content2', {
      url: "/content/:contentId",
      views: {
        "state" : { templateUrl: 'partials/content2.html',
          controller: function ($scope, $filter, $stateParams) {
              console.log($stateParams.contentId);
              //console.log($scope.posts);
              var filterStr = 'content/' + $stateParams.contentId;
              $scope.filtered = $filter('filter')($scope.posts, {url: filterStr});
              console.log($scope.filtered);
            }
        }
      }
    })
    .state('post', {
      url: "/post",
      views: {
        "state" : { 
          templateUrl: "partials/blog_post.html" },
          controller: "PostCtrl"
      }
    });

  $urlRouterProvider
  .otherwise('/index');

}])
.controller('PostCtrl', ['$scope', '$sce', '$anchorScroll', '$location', function($scope, $sce, $anchorScroll, $location) {<commit_msg>Finish retrieve post json and display<commit_after>'use strict';

angular.module('myApp', [
  'myApp.services',
	'ui.bootstrap',
	'ui.bootstrap.tpls',
  'ui.router'
])
.config(['$stateProvider', '$urlRouterProvider',
        function($stateProvider, $urlRouterProvider) {

  $stateProvider
    .state('index', {
      url: "/index",
      views: {
        "state" : { templateUrl: "index.html" }
      }
    })
    .state('list', {
      url: "/list",
      views: {
        "state" : { templateUrl: "partials/blog_list.html" }
      }
    })
    .state('content', {
      url: "/content",
      views: {
        "state" : { templateUrl: 'partials/content.html' }
      }
    })
    .state('content2', {
      url: "/content/:contentId",
      views: {
        "state" : { templateUrl: 'partials/content2.html',
          controller: function ($scope, $filter, $stateParams) {
              var filterStr = 'content/' + $stateParams.contentId,
                  filtered = $filter('filter')($scope.posts, {url: filterStr});
              console.log(filtered[0].url);
              console.log(filtered[0].date);
              $scope.fetchPost(filtered[0].url, filtered[0].date);
            }
        }
      }
    })
    .state('post', {
      url: "/post",
      views: {
        "state" : { 
          templateUrl: "partials/blog_post.html" },
          controller: "PostCtrl"
      }
    });

  $urlRouterProvider
  .otherwise('/index');

}])
.controller('PostCtrl', ['$scope', '$sce', '$anchorScroll', '$location', function($scope, $sce, $anchorScroll, $location) {
{'fraction_non_alphanumeric': 0.1836932001289075, 'fraction_numerical': 0.002578150177247825, 'mean_word_length': 2.2232606438213915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1583813', 'n_tokens_mistral': 981, 'n_tokens_neox': 971, 'n_words': 158}