this is my .ts file, when ever if condition fails and comes to else i want to display the request modal box so there is a function openModalDialog() , but it is showing undefined.
please help me thanks in advance
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
import { RequestModalComponent } from '../../request-modal/request-modal.component';
import axios from 'axios';
@Component({
selector: 'app-shared-scheduled',
templateUrl: './shared-scheduled.component.html',
styleUrls: ['./shared-scheduled.component.css'],
})
export class SharedOndatetimeScheduledComponent implements OnInit {
bsModalRef: BsModalRef;
constructor( private modalService: BsModalService ) { }
ngOnInit(): void {
}
openModalDialog() {
console.log("callling this method.......")
this.bsModalRef = this.modalService.show(RequestModalComponent);
}
navigateToTeleApp = () => {
axios.get("*******").then(function (res) {
console.log("response ...", res)
if (res.data.message == "Not Found"){
console.log("this condition....")
}
else {
console.log("this condition....222");
this.openModalDialog();
}
});
}