<commit_before>(function (module) {
    module.controller('ProjectHomeController', ProjectHomeController);
    ProjectHomeController.$inject = ["project", "modalInstance", "processTemplates", "$state"];

    function ProjectHomeController(project, modalInstance, processTemplates, $state) {
        var ctrl = this;

        ctrl.project = project;
        ctrl.chooseTemplate = chooseTemplate;
        ctrl.createSample = createSample;

        /////////////////////////

        function chooseTemplate() {
            modalInstance.chooseTemplate(ctrl.project);
        }

        function createSample() {
            var template = processTemplates.getTemplateByName('As Received');
            processTemplates.setActiveTemplate(template);
            $state.go('projects.project.processes.create');
        }
    }
}(angular.module('materialscommons')));<commit_msg>Simplify the dependencies and wait on the chooseTemplate service (modal) to return the process to create.<commit_after>(function (module) {
    module.controller('ProjectHomeController', ProjectHomeController);
    ProjectHomeController.$inject = ["project", "modalInstance", "templates", "$state"];

    function ProjectHomeController(project, modalInstance, templates, $state) {
        var ctrl = this;

        ctrl.project = project;
        ctrl.chooseTemplate = chooseTemplate;
        ctrl.createSample = createSample;

        /////////////////////////

        function chooseTemplate() {
            modalInstance.chooseTemplate(ctrl.project, templates).then(function(processTemplateName) {
                $state.go('projects.project.processes.create', {process: processTemplateName});
            });
        }

        function createSample() {
            $state.go('projects.project.processes.create', {process: 'As Received'});
        }
    }
}(angular.module('materialscommons')));
{'fraction_non_alphanumeric': 0.1388147357180993, 'fraction_numerical': 0.0, 'mean_word_length': 2.87991718426501, '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': '2140204', 'n_tokens_mistral': 447, 'n_tokens_neox': 428, 'n_words': 86}