<commit_before>﻿angular.module('gameOfDrones').
    controller('StartGameController', ['$scope', function ($scope) {

        $scope.gameSettings = {};
        $scope.imageUrl = '/Content/Images/events.png';

        $scope.startGame = function () {
            alert($scope.gameSettings.player1Name + ' - ' + $scope.gameSettings.player2Name);
        }
    }
]);<commit_msg>tied functionality for game initialization and redirect to game page<commit_after>﻿angular.module('gameOfDrones').
    controller('StartGameController', ['$scope', '$location', 'matchDataService', function ($scope, $location, matchDataService) {

        $scope.gameSettings = {};
        $scope.imageUrl = '/Content/Images/events.png';

        $scope.startGame = function () {

            var newMatch = {
                p1Name: $scope.gameSettings.player1Name,
                p2Name: $scope.gameSettings.player2Name,
            };

            matchDataService.create(newMatch)
                .success(function(data) {
                    console.log(data);
                    $location.path('/game/'+data.id);
                });
        }
    }
]);
{'fraction_non_alphanumeric': 0.14462081128747795, 'fraction_numerical': 0.005291005291005291, 'mean_word_length': 2.2803468208092488, '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': '5044242', 'n_tokens_mistral': 315, 'n_tokens_neox': 300, 'n_words': 45}