AngularJS alert strange behavior

46 Views Asked by At

I have a bit strange behavior using alert. Here is the point of my function:

 $scope.saveAll = function(exitAfterSave){
      //some logic..      
    var message = "The alert text changes depends on configuration";
    var saveAll = projectService.saveAll(filePrefix, rootPath, project);
    saveAll.then(function() { 
          alert(message);
          if(exitAfterSave === true){
           setTimeOut(function(){ exit(); }, 1000);
          }
    }).catch(function(error){ alert('Save Failed', error) })
}

And the exit function is pretty simple

function exit() {
var gui = require('nw.gui');
gui.App.quit();
}

So what I have here is a save and exit functions (both work), the saveAll() returns a promise. When the promise is resolved, I alert the user according to the resolve/reject. When the save is successful, the alert displays some weird window like icon instead of my message (see attached image). What can it be? I can't figure it out. Note: this happening on a specific machine, and not on my dev computer.

This is the error

1

There are 1 best solutions below

0
Dima Shivrin On BEST ANSWER

This computer has some problems with native popup boxes. Alert, prompt and confirm does not displayed properly. I ended up replacing it with third party pop up boxes (alertify) and it worked fine. I don't know why this happens, This is just a bypass and not a full solution, but it works.