I have these two views:
1) foo.html
Hello {{name}}
2) foo-as-modal.html
You can not use the same controller for a page view and for a modal window. At least, untill controller depends on $uibModalInstance.
$uibModalInstance
$uibModalInstance can be injected only in modals.