I'm getting an error when using this library in Angular project, I'm providing c3js as an injectable service and seem that Angular adds a property called __anonymousType to target function.
When binding this to target chart inside `function Chart' on line 1047 this causes an error:
ERROR TypeError: fn[key].bind is not a function
at c3.js:1047
at Array.forEach (<anonymous>)
at bindThis (c3.js:1046)
at c3.js:1049
at Array.forEach (<anonymous>)
at bindThis (c3.js:1046)
at new Chart (c3.js:1052)
Can a simple check be added fn[key].hasOwnProperty('bind') or similar to prevent binding this to any property that other libs may be injecting, this is also future proofing code is some props are not a fn.
This gets even worse on the following line where this is assigned recursively as this injected prop is a string.. getting a stack overflow.
I had to add typeof fn[key] === 'function' check
I'm getting an error when using this library in Angular project, I'm providing c3js as an injectable service and seem that Angular adds a property called
__anonymousType
to target function. When binding this to target chart inside `function Chart' on line 1047 this causes an error:Can a simple check be added fn[key].hasOwnProperty('bind') or similar to prevent binding this to any property that other libs may be injecting, this is also future proofing code is some props are not a fn.