[Chartjs]-Error in compilation for chart.js Expected method shorthand in object literal ('{label() {…}}'

3👍

I think you have a TSLint error there, rather than a TypeScript error.

It wants you to change:

 label: function(tooltipItem, dataChartTemperature) {

To:

 label: (tooltipItem, dataChartTemperature) => {

This would only impact you if there is some scoped item in there that could be lost by a change of context, but I guess TSLint hearts arrow functions.

This is the TSLint object-shorthand rule I think you are triggering, along with how to change it if you want to.

Leave a comment