title: AngularJS $scope Undefined When Compiling Controller In Directive
body: <p>I'm using ant to build/uglyfy my AngularJS and each time I have a controller in a directive, I get an undefined $scope error. Example of code is this:</p>
  
  <pre><code>app.directive('directive1',['$compile', '$http',function($compile, $http) {
      return {
          restrict: "A",
          controller : function($scope) {
              var posts = {};
              this.addPosts = function($scope, newPosts) {
  
                  angular.extend(posts, newPosts);
                  //$scope.$apply(function() {
                      $scope.posts = posts;
                  //});
              };
          },
          link: function (scope, element, attrs) {
             scope.posts = {};
          }
      };
  }]);
  </code></pre>
  
  <p>My question is, how can I define the $scope of the controller to when it is compiled it doesn't come up as undefined?</p>