<commit_before>(function(){
  'use strict';

  angular
    .module('slackChallenge.view1', [])
    .controller('View1Ctrl', ['$scope', '$stateParams', '$http', View1Ctrl]);

  function View1Ctrl ($scope, $stateParams, $http) {
    $scope.url = $stateParams.url;
    if(angular.isDefined($scope.url)){
    $http({
      url: '/api/url?url=' + $scope.url,
      method: 'GET',
    }).success(function(data){
      $scope.data = data;
      $scope.$broadcast('data', $scope.data);
    }).error(function(error){
      console.log('error');
    });
    }
  };
})();<commit_msg>Broadcast error message<commit_after>(function(){
  'use strict';

  angular
    .module('slackChallenge.view1', [])
    .controller('View1Ctrl', ['$scope', '$stateParams', '$http', View1Ctrl]);

  function View1Ctrl ($scope, $stateParams, $http) {
    $scope.url = $stateParams.url;
    if(angular.isDefined($scope.url)){
      $http({
        url: '/api/url?url=' + $scope.url,
        method: 'GET',
      }).success(function(data){
        $scope.data = data;
        $scope.$broadcast('data', $scope.data);
      }).error(function(error){
        console.log(error);
        $scope.$broadcast('data', {'summary': {}, 'source': 'Error while fetching ' + $scope.url + '.\n\n' + error});
      });
    }
  };
})();
{'fraction_non_alphanumeric': 0.21894409937888198, 'fraction_numerical': 0.006211180124223602, 'mean_word_length': 3.1580645161290324, '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': '7033381', 'n_tokens_mistral': 434, 'n_tokens_neox': 427, 'n_words': 73}