Answer the question
In order to leave comments, you need to log in
How to override method in Prototype in Typescript?
It is necessary to ignore the method in the external lib. How to do it?
I did so, but with AOT compilation it does not bring any effect.
DataTableBodyComponent.prototype.updatePage = () => {}
export class DataTableBodyComponent {
updatePage(direction: string): void {
//some code...
}
}
Answer the question
In order to leave comments, you need to log in
I hacked like this: I
added a component to the root one and hacked it
<div [hidden]="true">
<ngx-datatable #dataTable
[rows]="[]"
[columns]="[]">
</ngx-datatable>
</div>
export class RootComponent implements OnInit{
@ViewChild('dataTable') dataTable: DatatableComponent;
ngOnInit(): void {
Object.getPrototypeOf(this.dataTable.bodyComponent).updatePage = () => {
console.log("Skip Update Page")
};
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question