The .bind(this) gives the old values first and then updates with the new value which is not the right way to bind every time it should give the fresh value.
Here is the parent component function ts
this.openEdgeTokenSuccessCallback = this.openEdgeTokenSuccessCallback.bind(this);
openEdgeTokenSuccessCallback(reason) {
console.log(response, 'value');
}
parent HTML
<sc-ui-ezi-debit-card [onTokenSuccess]="openEdgeTokenSuccessCallback"></sc-ui-ezi-debit-card>
first, it gives 1 value and then 2 as value but I need this as 2 fresh values because 1 I have already used but when I again call the same function it gives first value 1 and then values 2
JS function
export function SetupOpenEdgeEziDebit(tokenSuccessFunction) {
secureEntryForm.onResult(tokenSuccessFunction);
}
child component ts :
ngOnInit(): void {
this.awaitOpenCardLessEdge();
}
private awaitOpenCardLessEdge(): void {
// Call open edge to start loading in the iframes.
SetupOpenEdgeEziDebit(this.onTokenSuccess);
console.log(this.onTokenSuccess)
}