btford/astral-angular-annotate — pull request #5 by alxhill (2013-10-17 18:47:42+00:00)
Title: Added support for CoffeeScript class syntax

CoffeeScript classes can be useful in AngularJS applications when writing factories, services and controllers (using the new 'Controller as' syntax). More here: http://alxhill.com/blog/articles/angular-coffeescript/

Here's one way to use coffee classes in Angular:

```coffeescript
angular.module('app').service 'TestService', class TestService
constructor: ($scope, $timeout, $http) ->
```

This is converted into the following JavaScript.
```javascript
var TestService;

angular.module('app').service('TestService', TestService = (function() {
function TestService($scope, $timeout, $http) {}

return TestService;

})());
```

Of course, ngmin fails for this, so it's necessary to add in the $inject array manually.

This pull request allows ngmin to detect the JavaScript above and convert it into
```javascript
var TestService;

angular.module('app').service('TestService', ['$scope', '$timeout', '$http', TestService = (function() {
function TestService($scope, $timeout, $http) {}

return TestService;

})()]);
```

I've tested this with a few different cases and it seems to be reliable.