Android : setInterval() not working after window.open() in Android

on Monday, February 16, 2015


Just a little problem : I'm making an Hybrid app developed in angular with Cordova but when I use a setInterval() function after a $window.open() the setInterval stop working, but in chrome it's working (but it's normal, the new window is opened in a new tab).


This is the an extract of my code :



$http.post(url)
.success(function(result, status) {
var windowWithings = $window.open(result.res);
var intervalVerif = $window.setInterval(function (){
$http.get(url)
.success(function(result) {
windowWithings.close();
$window.cancelInterval(intervalVerif);
})
.error(function(error) {
console.log(error);
});
}, 2000);
})
.error(function(error, status) {
console.log(status);
});


Thanks by advance !


0 comments:

Post a Comment