<commit_before>'use strict';

angular.module('berlinerSchulenApp')
	.factory('schoolFactory', ['$http', '$rootScope', function($http, $rootScope){
		var schools = {content:null};

		schools.updateFilter = function(val) {
			schools.content = [val];
			if (val === 'new' || val === '') {
				schools.getJson();
			}
		};

		schools.getJson = function() {

			$http.get('data/schools.json').success(function(data) {
				// you can do some processing here
				schools.content = data;
				$rootScope.$broadcast('updateSchools');
			});
		};

		schools.getJson();

		return schools;
	}]);<commit_msg>Add setFilter and applyFilter function in schoolFactory<commit_after>'use strict';

angular.module('berlinerSchulenApp')
	.factory('schoolFactory', ['$http', '$rootScope', function($http, $rootScope){

		var schools = {content:null};
		var filter = {};

		/**
		 * set new filter properties but do not apply filter
		 * @param Obj filerProp new filter properties
		 * @return Obj this
		 */
		schools.setFilter = function(filterProp) {
			filter = filterProp;
			return schools;
		};

		/**
		 * start filtering and broadcast new school set
		 * @return Obj this
		 */
		schools.applyFilter = function() {
			console.log('filter: ' + filter);

			return schools;
		};

		schools.getJson = function() {

			$http.get('data/schools.json').success(function(data) {
				// you can do some processing here
				schools.content = data;
				$rootScope.$broadcast('updateSchools');
			});
		};

		schools.getJson();

		return schools;
	}]);
{'fraction_non_alphanumeric': 0.15858453473132372, 'fraction_numerical': 0.0, 'mean_word_length': 3.641337386018237, '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': '5617092', 'n_tokens_mistral': 563, 'n_tokens_neox': 470, 'n_words': 109}