btford/ngmin

Still does not annotate directive.controller

scottnewman opened this issue · 5 comments

Issue #21 fixed it in part. See there.

But this case still seems to fail (where the directive function is declared globally):

function myDirective($rootScope) {
return {
restrict: 'A',
controller: function($scope) {
this.scope = $scope;
}
}
}

angular.module('some-module').directive('some-directive', myDirective);

Addendum:

This also doesn't work (where the controller function within the directive is declared globally):

function myFunction($scope) {
this.scope = $scope;
}
angular.module('some-module').directive('some-directive', function myDirective($rootScope) {
return {
restrict: 'A',
controller: myFunction
}
});

I have prepared two failing tests that illustrate the issue: https://github.com/gurdiga/ngmin/commit/c62e5b64b6c744f4ec075193b11e47e66efe69ad. I hope this clarifies it a bit.

@gurdiga thanks! I'll take a look.

has bitten me

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.