btford/ngmin

Is there a way to detect and minify controller inside a controller?

Closed this issue · 2 comments

For example, I've been using angular bootstrap ui. Here is my controller,

angular.module('myApp').controller('HomeCtrl', function($scope, $modal) {

    // My inner controller
    var ModalCtrl = function($scope, $modalInstance, event) {
        ....
     });

     $modal.open({
          ....
          controller : ModalCtrl
     });
});

Now when i use grunt to minify this piece of code, its not able to add annotation injection for the inner controller.

I think I have the same problem but in a more general way. I mean, I have this piece of code:

(function () {
  'use strict';
  app.controller('MainCtrl', function (SelectedFacets, cookieStore, $modal, SETTINGS, Document, Navigation, Search, ViewConfiguration, $timeout, $rootScope, $scope, $routeParams, $window, $location, $filter) {
  };
})();

And it does not get ngminified. I think it worked before I add the closures.

Please try https://github.com/olov/ng-annotate. ngmin is now deprecated: #93

If your issue isn't resolved there please open an issue at https://github.com/olov/ng-annotate/issues

If you really want ngmin to fix this issue, feel free to fork it and use that.