AngularJS Material sending data through md-dialog to separate controller

I have a form with a button for an employee lookup, which is handled by a md-dialog. When someone clicks the button, this function is run:

//Employee Lookup button
$scope.emplLookupButton = function(){

     $scope.selectedEmpl = res;
     return $scope.selectedEmpl;


This function calls a factory, which I'm using like a service:


    let parentEl = angular.element(document.body);
    let employeeMain = '';

    function emplLookupDialog($event){
      return  ${
        parent: parentEl,
        targetEvent: $event,
        templateUrl: '**template name here**',
        clickOutsideToClose: true,
        hasBackdrop: true
        employeeMain = res;
        return employeeMain;

   return {
     employeeMain: employeeMain,
     emplLookupDialog: emplLookupDialog

This all works good. However, in my template I am giving the users the ability to click an employee, and return its value back to the parent form. I would like to take the returned data from the md-dialog here and set it equal to the model that the particular input is using, in the original controller.

I can console log the data from the dialog within the factory, so I know its being returned from the dialog controller to there, but I can't seem to get it from the factory to the original controller.

The returned data from the original code block doesn't return anything, presumably because it's looking for a return before anything has been sent. To get around this, I have attempted the following:

$scope.userInputMain = {
  employee: mdDialogService.employeeMain

But that's not getting me anywhere. What have i missed?