'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;
	}]);

@@ -125,16 +125,17 @@
 Scope)%7B%0A
+%0A
 %09%09var sc
@@ -158,16 +158,172 @@
 :null%7D;%0A
+%09%09var filter = %7B%7D;%0A%0A%09%09/**%0A%09%09 * set new filter properties but do not apply filter%0A%09%09 * @param Obj filerProp new filter properties%0A%09%09 * @return Obj this%0A%09%09 */
 %0A%09%09schoo
@@ -325,22 +325,19 @@
 schools.
-update
+set
 Filter =
@@ -350,108 +350,248 @@
 ion(
-val) %7B%0A%09%09%09schools.content = %5Bval%5D;%0A%09%09%09if (val === 'new' %7C%7C val === '') %7B%0A%09%09%09%09schools.getJson(
+filterProp) %7B%0A%09%09%09filter = filterProp;%0A%09%09%09return schools;%0A%09%09%7D;%0A%0A%09%09/**%0A%09%09 * start filtering and broadcast new school set%0A%09%09 * @return Obj this%0A%09%09 */%0A%09%09schools.applyFilter = function() %7B%0A%09%09%09console.log('filter: ' + filter
 );%0A
+%0A
 %09%09%09
-%7D
+return schools;
 %0A%09%09%7D

Add setFilter and applyFilter function in schoolFactory