Open draytond opened 9 years ago
or use "newcap": false ... its quire common on github
It is just a style convention, however our project style conventions do require caps on our constructors. Others might not have the same rule, but for teams like ours, giving it a capital letter would make it easier to use in our projects. Might improve adoption.
angular.module('app')
.factory('MyNgTableParams', ['ngTableParams', (ngTableParams) ->
class MyNgTableParams extends ngTableParams
])
Indeed, that's a fine workaround. We found our own work around as well. I only make the recommendation to make adoption for teams like mine more seamless, so such workarounds are not necessary. It's not a bug per se, more just something I think will improve ease of integration, and bring it more in-line with widely held conventions.
This line violates javascript naming conventions, causing it to break builds that depend on JSCS or JSHINT:
$scope.tableParams = new ngTableParams(parameters, settings);
So when we create a new object, causes our build to fail with a JSCS error, saying that constructor functions are supposed to be capitalized. This should be an easy one to fix, and will help loads of people use this with JSCS or JSHINT.