title: injecting $http into directive controller and minification
body: <p>I'm getting one of these in my prod environment</p>
  
  <pre><code>[$injector:unpr] http://errors.angularjs.org/1.2.2/$injector/unpr?p0=nProvider
  </code></pre>
  
  <p>My directive is something along these lines</p>
  
  <pre><code>var app = angular.module('myDir', []);
  
  function link(scope, elm, attrs) {
      scope.$watch('Potato', function (nVal) {
          if (nVal) {
              elm.html(Potato);
          }
       }
  
  function someDir(http, compile) {
      function controller($scope, http) {
          http.get('/some/service/' + $scope.someThing).success(function (result) {
              scope.Potato = result;
              console.log('hooray');
          });
      };
  
      var dirObject = {
          restrict: 'A',
          scope: {
              'someThing': '='
          },
          link: link,
          controller: controller
      };
  
      return dirObject;
  };
  app.directive('someDir', ['$http', '$compile', someDir]);
  </code></pre>
  
  <p>Is this how I should be handling injecting <code>$http</code> into a directive controller? Solution is hosted on azure, and minified via <code>ASP.NET MVC</code> bundles.</p>
  
  <p>If I render all my script files individually instead of letting them get minified, everything works, but when they get minified I get the unknown provider error.</p>
  
  <p><strong>Adding controller that is running outside of the directive.</strong></p>
  
  <pre><code>angular.element(document).ready(function () {
      "use strict";
  
      var profileApp = angular.module('profileApp', ['myDir']);
  
      function ProfileCtrl(scope) {
  
          scope.companyId = angular.element("#Id").val();
  
      };
  
      profileApp.controller('ProfileCtrl', ['$scope', ProfileCtrl]);
  
      angular.bootstrap(document, ['profileApp']);
  
  });
  </code></pre>