title: How to use the same controller for modal and non-modal form in Angular UI Bootstrap?
body: <p>I've got a modal with a registration form. The same form should be displayed at the bottom of the landing page not in a modal.</p>
  
  <p>Currently my controller that handles registration modal takes <code>$modalInstance</code> as one of its parameters along <code>$scope</code> etc. If I add <code>ng-controller="SignUpCtrl"</code> to an element in the landing page, it doesn't work, because the controller wasn't created via <code>$modal.open</code> method and so Angular complains about <code>Unknown provider: $modalInstanceProvider &lt;- $modalInstance</code>.</p>
  
  <p>I've got a service for registering users (<code>authService.signUp(data).then/catch...)</code>, but the controller itself does a bit more - handles input, emits events (e.g. with translated error messages), sets cookies etc.</p>
  
  <p>What's the best way to handle such case without duplicating almost whole controller code? Should I move the code from controller into yet another, higher-level service?</p>