You should refactor function declarations as following:
var modalDemoCtrl = function($scope, $uibModal, $log, $document)
function modalDemoCtrl($scope, $uibModal, $log, $document)
var ModalInstanceCtrl = function($uibModalInstance)
This way you can reference to the functions from previous code in file.
Also, you shouldn't pass