grofit / aurelia-chart

A chart element for aurelia which is powered by chart js using html5 canvas.
MIT License
46 stars 25 forks source link

Binding to native-options not working #32

Closed Tarpsvo closed 7 years ago

Tarpsvo commented 7 years ago

Hey.

I am, for some unknown reason, unable to bind to the native-options property.

The most straight forward copied example does not work.

Example used: <chart type="pie" data.bind="myData" native-options.bind="{ segmentShowStroke: true, segmentStrokeColor: '#fff', segmentStrokeWidth: 2 }"></chart>

Error returned: Unhandled rejection Error: Binding expression "{'segmentShowStroke':true,'segmentStrokeColor':'#fff','segmentStrokeWidth':2}" cannot be assigned to.

Some maybe related info: WebPack 2.3. AureliaWebPackPlugin 2-RC2.

grofit commented 7 years ago

do you need the { and } brackets? it may be an issue with my documentation as it was all written years ago, so it may be a case of the bind does not need the brackets and gets confused with them, if that doesnt work then I am not sure, but it looks like its the core aurelia binding which is confused not the loader or anything.

Tarpsvo commented 7 years ago

Binding to an object created inline is not something I could get to work. I just created the object in the view controller and bound to it.