(function (module) {
    module.factory('modalInstance',
        ["$modal", "mcapi", function ($modal, mcapi) {
            var service = {
                modal: {},
                openModal: function (item, type, project) {
                    service.modal = {
                        instance: null,
                        item: {}
                    };
                    var template = '';
                    switch (type) {
                        case "datafile":
                            template = 'application/core/projects/project/home/directives/display-file.html';
                            service.modal.item = item;
                            break;
                        case "sample":
                            template = 'application/core/projects/project/home/directives/display-sample.html';
                            mcapi('/sample/measurements/%/%', item.id, item.property_set_id)
                                .success(function (properties) {
                                    item.properties = properties;
                                    service.modal.item = item;
                                })
                                .error(function (err) {
                                    console.log(err)
                                })
                                .jsonp();
                            mcapi('/sample/datafile/%', item.id)
                                .success(function (files) {
                                    item.linked_files = files;
                                }).jsonp();
                            break;
                        case "process":
                            template = 'application/core/projects/project/home/directives/display-process.html';
                            service.modal.item = item;
                            break;
                    }
                    service.modal.instance = $modal.open({
                        size: 'lg',
                        templateUrl: template,
                        controller: 'DisplaySampleController',
                        resolve: {
                            modal: function () {
                                return service.modal;
                            },
                            project: function () {
                                return project;
                            }
                        }
                    });
                    return service.modal.instance;
                },
                chooseTemplate: function (project) {
                    service.modal = {
                        instance: null,
                        items: []
                    };

                    service.modal.instance = $modal.open({
                        size: 'lg',
                        templateUrl: 'application/core/projects/project/processes/template.html',
                        controller: 'TemplateInstanceController',
                        resolve: {
                            modal: function () {
                                return service.modal;
                            },
                            project: function () {
                                return project;
                            }
                        }
                    });
                },

                viewSetUp: function (properties) {
                    service.modal = {
                        instance: null,
                        properties: properties
                    };

                    service.modal.instance = $modal.open({
                        size: 'lg',
                        templateUrl: 'application/core/projects/project/processes/view_setup.html',
                        controller: 'setupViewController',
                        controllerAs: 'ctrl',
                        resolve: {
                            modal: function () {
                                return service.modal;
                            }
                        }
                    });
                },

                preFill: function (template, project) {
                    var modal = $modal.open({
                        size: 'lg',
                        templateUrl: 'application/core/projects/project/processes/prefill.html',
                        controller: 'projectPreFillProcess',
                        controllerAs: 'ctrl',
                        resolve: {
                            template: function () {
                                return template;
                            },
                            project: function() {
                                return project;
                            }
                        }
                    });
                    return modal.result;
                }
            };
            return service;
        }]);
}(angular.module('materialscommons')));

@@ -2476,32 +2476,33 @@
              %7D,%0A
+%0A
                 
@@ -2538,190 +2538,52 @@
 ject
-) %7B%0A                    service.modal = %7B%0A                        instance: null,%0A                        items: %5B%5D%0A                    %7D;%0A%0A                    service.modal.instance
+, templates) %7B%0A                    var modal
  = $
@@ -2787,32 +2787,78 @@
 nceController',%0A
+                        controllerAs: 'ctrl',%0A
                 
@@ -2896,37 +2896,39 @@
                 
-modal
+project
 : function () %7B%0A
@@ -2962,37 +2962,31 @@
      return 
-service.modal
+project
 ;%0A          
@@ -3026,39 +3026,41 @@
                 
-project
+templates
 : function () %7B%0A
@@ -3045,33 +3045,32 @@
 plates: function
- 
 () %7B%0A           
@@ -3089,39 +3089,41 @@
          return 
-project
+templates
 ;%0A              
@@ -3180,32 +3180,73 @@
             %7D);%0A
+                    return modal.result;%0A
                 

Change chooseTemplate to act like a modal and not use the global service.modal.