When attempting to invoke an Angular function from a JavaScript function, I am encountering an issue where it is displaying as undefined.
Below is an example demonstration I have created:
import { Component, NgZone, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { GetSelectedProductService } from '../ServiceOfService/get-selected-product.service';
import { Router } from '@angular/router';
function process(){
..
..
this.processDone(response);
//when I call processDone function from here, it throws an 'undefined exception'.
}
@Component({
selector: 'app-payment-process',
templateUrl: './payment-process.component.html',
styleUrls: ['./payment-process.component.css']
})
export class PaymentProcessComponent implements OnInit {
constructor() {}
ngOnInit(): void { }
processDone(response){
console.log(response);
}
}