<commit_before>var sjModule = angular.module('sj');

sjModule.controller('searchController', ['$scope', '$http', '$timeout',
	function ShortcutController($scope, $http, $timeout) {

		$http.get('/api/search/initial').success(function(data, status, headers, config) {
			$scope.searchChoices = data.searchChoices;
		})

		$scope.searchType = {};
		$scope.searchCriteria = '';

		$scope.search = function() {
			var criteria = {
				criteriaKey: $scope.searchType.name,
				criteriaValue: $scope.searchCriteria
			};

			var config = {
				params: criteria
			}

			$http.get('api/search', config).success(function(data, status, headers, config) {
				$scope.foundShortcuts = data.foundShortcuts;
			});
		};
	}
]);

sjModule.directive('results', function(){
	return {
		template:
			'\
			<h3>Results</h3>\
			<ul ng-repeat="shortcut in foundShortcuts">\
				<li>application = {{shortcut.application}}</li>\
		        <li>operatingSystem = {{shortcut.operatingSystem}}</li>\
		        <li>keyset = {{shortcut.keyset}}</li>\
	            <li>description = {{shortcut.description}}</li>\
		        <li>id = {{shortcut._id}}</li>\
			</ul>\
			'
	}
});<commit_msg>Results header renders only after search<commit_after>var sjModule = angular.module('sj');

sjModule.controller('searchController', ['$scope', '$http', '$timeout',
	function ShortcutController($scope, $http, $timeout) {

		$http.get('/api/search/initial').success(function(data, status, headers, config) {
			$scope.searchChoices = data.searchChoices;
		})

		$scope.searchType = {};
		$scope.searchCriteria = '';

		$scope.search = function() {
			var criteria = {
				criteriaKey: $scope.searchType.name,
				criteriaValue: $scope.searchCriteria
			};

			var config = {
				params: criteria
			}

			$http.get('api/search', config).success(function(data, status, headers, config) {
				$scope.foundShortcuts = data.foundShortcuts;
			});
		};
	}
]);

sjModule.directive('results', function(){
	return {
		template:
			'\
			<h3 ng-if="foundShortcuts">Results</h3>\
			<ul ng-repeat="shortcut in foundShortcuts">\
				<li>application = {{shortcut.application}}</li>\
		        <li>operatingSystem = {{shortcut.operatingSystem}}</li>\
		        <li>keyset = {{shortcut.keyset}}</li>\
	            <li>description = {{shortcut.description}}</li>\
		        <li>id = {{shortcut._id}}</li>\
			</ul>\
			'
	}
});
{'fraction_non_alphanumeric': 0.18565400843881857, 'fraction_numerical': 0.0016877637130801688, 'mean_word_length': 3.5421455938697317, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '5514151', 'n_tokens_mistral': 897, 'n_tokens_neox': 758, 'n_words': 122}