{"size": 375, "ext": "js", "max_stars_repo_path": "public/includes/scripts/controllers/main.js", "max_stars_repo_name": "datkinson/localisation-web", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/includes/scripts/controllers/main.js", "max_issues_repo_name": "datkinson/localisation-web", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/includes/scripts/controllers/main.js", "max_forks_repo_name": "datkinson/localisation-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.8461538462, "max_line_length": 97, "alphanum_fraction": 0.6666666667}
application.controller('mainController', function($scope, $rootScope, $location, general, user) {
	$scope.general = general;
	$scope.user = user;
	
	// on recieving location message redirect client to the recieved route
	socket.on('location', function (data) {
		if(!$scope.user.isAdmin) {
			$rootScope.$apply(function() {
				$location.path("/" + data);
			});
		}
	});
});