title: Unit-testing directive controllers in Angular without making controller global
body: <p>In Vojta Jina's excellent repository where he demonstrates testing of directives, he defines the directive controller outside of the module wrapper. See here:
  <a href="https://github.com/vojtajina/ng-directive-testing/blob/master/js/tabs.js">https://github.com/vojtajina/ng-directive-testing/blob/master/js/tabs.js</a></p>
  
  <p>Isn't that bad practice and pollute the global namespace?</p>
  
  <p>If one were to have another place where it might be logical to call something TabsController, wouldn't that break stuff?</p>
  
  <p>The tests for the mentioned directive is to be found here: <a href="https://github.com/vojtajina/ng-directive-testing/commit/test-controller">https://github.com/vojtajina/ng-directive-testing/commit/test-controller</a></p>
  
  <p>Is it possible to test directive controllers separate from the rest of the directive, without placing the controller in a global namespace?</p>
  
  <p>It would be nice to encapsulate the whole directive within the app.directive(...) definition.</p>