(function (module) {
    module.controller("SamplesController", SamplesController);
    SamplesController.$inject = ["$state", "project", "$filter", "samples", "processTemplates"];

    function SamplesController($state, project, $filter, samples, processTemplates) {
        var ctrl = this;

        ctrl.project = project;
        ctrl.viewSample = viewSample;
        ctrl.samples = samples;
        ctrl.createSample = createSample;

        if (ctrl.samples.length !== 0) {
            var sortedSamples = $filter('orderBy')(ctrl.samples, 'name');
            ctrl.current = sortedSamples[0];
            $state.go('projects.project.samples.list.edit', {sample_id: ctrl.current.id});
        }

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

        function viewSample(sample) {
            ctrl.current = sample;
            $state.go('projects.project.samples.list.edit', {sample_id: ctrl.current.id});
        }

        function createSample() {
            var template = processTemplates.getTemplateByName('As Received');
            processTemplates.setActiveTemplate(template);
            $state.go('projects.project.processes.create');
        }
    }
}(angular.module('materialscommons')));
@@ -155,28 +155,8 @@
 les%22
-, %22processTemplates%22
 %5D;%0A%0A
@@ -223,26 +223,8 @@
 ples
-, processTemplates
 ) %7B%0A
@@ -909,144 +909,8 @@
     
-var template = processTemplates.getTemplateByName('As Received');%0A            processTemplates.setActiveTemplate(template);%0A            
 $sta
@@ -950,16 +950,58 @@
 .create'
+, %7Bprocess: 'As Received', process_id: ''%7D
 );%0A     

Create sample using new process create method.