Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Windows Asynchronous #560

Closed
raky291 opened this issue Apr 16, 2016 · 1 comment
Closed

Open Windows Asynchronous #560

raky291 opened this issue Apr 16, 2016 · 1 comment

Comments

@raky291
Copy link

raky291 commented Apr 16, 2016

Chrome is blocking the popup I am creating. After some tests it appears to be an issue with window.open in asynchronous callback.

for example:

$scope.generatePdf = function () {
    $http.post('/someUrl', data).then( function (response) {
    pdfMake.createPdf(docDefinition).open();
  });
};

win

My solution was to add a new parameter called win and add an if (look at the picture).

Now it works...

$scope.generatePdf = function () {
    var win = window.open('', '_blank');
    $http.post('/someUrl', data).then( function (response) {
    pdfMake.createPdf(docDefinition).open(win);
  });
};

If I place the open.window outside of the callback that it works, but inside it is blocked.

Sorry for my English.

@liborm85
Copy link
Collaborator

duplicate: #587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants