I'm having trouble with the code I used. When the PHP call succeeds, I trigger the click event but it's not working inside the HTTP GET method. However, if I place it outside the HTTP method, it works fine.
In my component.html file:
<a #myDiv id="anchorID" href="{{details.url}}&a={{affid}}&b={{sid}}&c={{ordid}}" target="_blank"></a>
In my component.ts file:
this.http.get(this.apiurl+'api/insertorder.phpumid="+this.loginid).subscribe(data=>{
var jsonData = data.json();
let urlpass = jsonData.url;
this.ordid = jsonData.orderid;
$("#anchorID")[0].click();
},error => {
console.log('error in sub');
console.log(error);
});
I'm wondering what could be wrong here. I need to make sure this gets called after a successful response.
If I use window.open(urlpass,'_blank');
then it triggers a popup blocker issue. Any help on how to resolve this would be greatly appreciated.