<commit_before>var myApp = angular.module('myApp', ['ui.router']);

myApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider){
	$urlRouterProvider.otherwise("/");
	$stateProvider.state('home', { 
        url:'/',
        templateUrl: 'home.html',
		controller: 'HomeController'
    }).state('user', {
		url:'/user',
        templateUrl: 'user.html',
		controller: 'UserController'
    });
}]);
			
myApp.controller('UserController', ['$scope', '$state',function($scope, $state){
	$scope.users = [];
	
	$scope.addUser = function (user) {
		$scope.users.push(angular.copy(user));
	}
	
	$scope.backToHome = function () {
		$state.go('home');
	}
}]);

myApp.controller('HomeController', ['$scope', '$state',function($scope, $state){
	$scope.goToUsers = function () {
		$state.go('user');
	}
}]);<commit_msg>add a service to save the users<commit_after>var myApp = angular.module('myApp', ['ui.router']);

myApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider){
	$urlRouterProvider.otherwise("/");
	$stateProvider.state('home', { 
        url:'/',
        templateUrl: 'home.html',
		controller: 'HomeController'
    }).state('user', {
		url:'/user',
        templateUrl: 'user.html',
		controller: 'UserController'
    });
}]);
			
myApp.controller('UserController', ['$scope', '$state', 'UserService', function($scope, $state, UserService){
	$scope.users = UserService.users;
	
	$scope.addUser = function (user) {
		UserService.users.push(angular.copy(user));
	}
	
	$scope.backToHome = function () {
		$state.go('home');
	}
}]);

myApp.controller('HomeController', ['$scope', '$state',function($scope, $state){
	$scope.goToUsers = function () {
		$state.go('user');
	}
}]);


myApp.factory('UserService', function () {
    var userService = {};
	userService.users = [];
	return userService;
});

{'fraction_non_alphanumeric': 0.21150772509323387, 'fraction_numerical': 0.0, 'mean_word_length': 4.7607361963190185, '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': '6994014', 'n_tokens_mistral': 636, 'n_tokens_neox': 604, 'n_words': 97}