After a little search I came across one solution to make the server call synchronous, then the new tab/window ‘opening code’ would be directly in the user event and there will be no problem in the intended purpose.
Keeping the above consideration in mind, came with one more solution, one solution that can by-pass the situation.
Make the server call synchronous, so that the new tab/window opening code be directly in the user event handler. (plunker)
Create one window, in the same closure, as the server call is made and keep the reference to it in a variable. And in the success handler of the call, change the location of the window created in-prior or close the same in error handler. (Closing the window may be a problem for Chrome & Firefox) (plunker)
In the success handler create one confirmation dialog for the user, and in the ‘OK’ handler create the intended new tab/window.
There may be another solution to create a form with target=”_blank” and in the action we will do the intended server call. But, I’ve not tried it. And this may not be a very good approach.