karlgoldstein/grunt-html2js — pull request #51 by trungnguyenn (2014-09-12 08:50:42+00:00)
Title: Introduce 'newModule' (boolean) to make html2js could work easily on existing AngularJS module

AngularJS allows to call directly `run(['$templateCache', function($templateCache) {..}])` method on an existing AngularJS module by setting 'require' argument of `angular.module(name, require, ...)` to null instead of an array object. But it is hard-coded by an empty array in current html2js code (singleMode=true).

Here is my scenario:

I have an AngularJS module 'app'. By using grunt-contrib-concat, I want to merge all parts (controllers, services, directives, filters...) from different files to a single file. The output is:

```
// Source: app/app.js
angular.module("app").config([function() {
...
}]);
// Source: app/directive/abc.js
angular.module('app').directive('abc', function() {
...
});
// Source: app/filters/abc.js
angular.module('app').filter('abc', function() {
...
});
```

I also want to add the js file contents generated by html2js for my templates to that single file but I couldn't if doing with current html2js code.
```
// Source: app/filters/abc.js
angular.module('app', []).filter('abc', function() { // new module with name 'app' is created because 'require' param is an array
...
});
```

So I expected the 'newModule' option can solve my problem.

Please review it.