klei / gulp-angular-filesort

Automatically sort AngularJS app files depending on module definitions and usage
MIT License
132 stars 46 forks source link

JS object dynamic key causes error in plugin 'gulp-angular-filesort' #48

Closed davidalekna closed 8 years ago

davidalekna commented 8 years ago

Hi all,

So I encountered this issue. I need to set a dynamic object key value, it works while gulp is serving, but once I stop serving and restart, or do gulp build it brings up following error:

[AngularFilesort] Error in plugin 'gulp-angular-filesort' Error in parsing: "templates/design/manage_labels.js", Line 146: Unexpected token [

Is there a way to fix this or does anyone have a solution for this? Query looks like this:

vm.query = { [keyword]: vm.addNewLabel }

davidalekna commented 8 years ago

If anyone else hit this issue: Angular filesort update did solve it but then I hit another gulp-uglify failure. My solution to this problem was assigning dynamic object key variable in a different fashion as follows:

var query = {}; query[keyword] = vm.addNewLabel;

Cheers

JSProto commented 7 years ago

Hi. I have the following error: [AngularFilesort] Error in plugin 'gulp-angular-filesort' Message: Error in parsing: ".../login.controller.js", Line 16: Unexpected token =>

error in this line:

arr.filter(v => v).length; // not working
arr.filter(function(v){ return v;}).length;  // working

arrow functions not supported?