Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6 spread syntax not getting compiled #15

Open
zxshinxz opened this issue Nov 8, 2016 · 1 comment
Open

ES6 spread syntax not getting compiled #15

zxshinxz opened this issue Nov 8, 2016 · 1 comment

Comments

@zxshinxz
Copy link

zxshinxz commented Nov 8, 2016

Hi there,

Thank you very much for angular2 brunch seed project.

Just reporting a problem where, whenever I use es6 spread syntax, It fails to compile.

e.g.


private getMaxY(): number {
    let maxValuesOfAreas = [];
    this.config.forEach(data => maxValuesOfAreas.push(Math.max.apply(Math, data.dataset.map(d => d.y))));
    return Math.max(...maxValuesOfAreas);
  }


08 Nov 13:47:04 - error: Compiling of app/directives/area-chart/area-chart.component.ts failed.  

If I change

    return Math.max(...maxValuesOfAreas); 

to

 return Math.max.apply(this,maxValuesOfAreas)(); 

works fine.

would there be specific typescript config for this issue.

Thank you
Andy

@colinbate
Copy link
Owner

I'm not sure your issue is with the spread operator specifically. I use it a fair bit without problem. It is possible that using it is causing some helper to be compiled in which is triggering an error because of the isolated way in which brunch-typescript compiles.

Check out https://github.com/baptistedonaux/brunch-typescript#errors and try disabling the errors, it is possible that it will produce the correct output, and the error is a side effect of how it is being compiled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants