Skip to content

ngOnChanges in LineChartComponent not implementing the Angular interface "OnChanges" #2071

@coljacarls

Description

@coljacarls

Describe the bug
Hey there!
When I extend the LineChartComponent and want to use ngOnChanges and pass it SimpleChanges, I receive an error:

TS2416: Property ngOnChanges in type CustomLineChartComponent is not assignable to the same property in base type LineChartComponent
Type (changes: SimpleChanges) => void is not assignable to type () => void
Target signature provides too few arguments. Expected 1 or more, but got 0

When looking at the implementation, I see you are using ngOnChanges without implementing the Angular interface:

To me, it looks like if you don't pass the SimpleChanges, I cannot use this hook correctly when extending your component. This might also apply to other charts as well.
Regards!

To Reproduce
Try to use "ngOnChanges" with SimpleChanges in a component extending the LineChartComponent.

Expected behavior
It should allow me to implement the Angular interface "OnChanges".

Screenshots

Demo

ngx-charts version
^19

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions