You need to establish a connection between the two controllers, and this can be achieved by creating a service.
Using this as a reference.
You can create a service as follows:
angular.module('myApp', []) .service('sharedInput', function () { var modalInput = ""; return { getModalInput:function () { return modalInput; }, setModalInput:function (value) { modalInput = value; } }; });
Then, in your ModalCtrl() function, I assume that you will have a button for input. Say clicking this button calls the "submitInput" function in the ModalCtrl area. You will write this function as:
$scope.submitInput = function() { sharedInput.setMOdalInput($scope.someinput); }
... and in your FormCtrl() you will write the following code to read modal input:
var input = sharedInput.getModalInput()
You also need to pass the parameter "sharedInput" to ModalCtrl and FormCtrl in the same way you passed $ scope. And now you have two of your controllers.
source share