Closed adben closed 8 years ago
If you define a computed property, you have to supply at least one depending property to the function string like so:
options: {
type: Object,
computed: 'computeOptions(someProperty)'
}
Otherwise the computeOptions
function is never called, because there is simply no "input" to compute the value. But I assume from your code that options
is not dependent of any other value, so it doesn't need to be computed. That means, what you probably need is the following definition:
options: {
type: Object,
value: function() {
return {
scaleShowGridLines: true,
scaleGridLineColor: "rgba(0,0,0,.05)",
scaleGridLineWidth: 1,
scaleShowHorizontalLines: true,
scaleShowVerticalLines: true,
bezierCurve: false,
pointDot: false,
datasetStroke: true,
datasetStrokeWidth: 20,
datasetFill: true
};
}
}
The function is called at creation time of the element and sets the options
property with the object.
Also syntax like computeOptions: function computeOptions() {
seems strange to me.
Maybe you meant to write computeOptions: function() {
?
Let me know if this helps.
@adben how are you getting on? is this still considered an issue?
Hi Rob,
My binding for the data is working, but it does not updates the options (as in Chart.js), what can be the issue?
Thank you in advance for your attention to this matter.