Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 在ionic中清除间隔后,计时器在后台运行 let countDownDate=new Date(返回_endate.toString()).getTime(); this.timerinterval=setInterval(函数(){ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离{ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离{ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离_Angular_Ionic Framework - Fatal编程技术网

Angular 在ionic中清除间隔后,计时器在后台运行 let countDownDate=new Date(返回_endate.toString()).getTime(); this.timerinterval=setInterval(函数(){ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离{ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离{ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离

Angular 在ionic中清除间隔后,计时器在后台运行 let countDownDate=new Date(返回_endate.toString()).getTime(); this.timerinterval=setInterval(函数(){ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离{ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离{ 现在让我们=new Date().getTime(); 让距离=倒计时日期-现在; 让天数=数学楼层(距离/(1000*60*60*24)); 让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60)); 分钟=数学楼层((距离%(1000*60*60))/(1000*60)); 设秒数=数学楼层((距离%(1000*60))/1000); 日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天); document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+ 分钟+米+秒+秒; 如果(距离,angular,ionic-framework,Angular,Ionic Framework,错误是使用关键字函数声明回调。改用这个: let countDownDate = new Date(returned_endate.toString()).getTime(); this.timerinterval = setInterval(() => { let now = new Date().getTime(); let distance = countDownDate - now; let days = Math.floor(distance / (1000 *

错误是使用关键字函数声明回调。改用这个:

let countDownDate = new Date(returned_endate.toString()).getTime();

this.timerinterval = setInterval(() => {

  let now = new Date().getTime();
  let distance = countDownDate - now;
  let days = Math.floor(distance / (1000 * 60 * 60 * 24));
  let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  let seconds = Math.floor((distance % (1000 * 60)) / 1000);
  console.log(now, "now", "countDownDate", countDownDate, "distance", distance, "days", days);
  document.getElementById("demo").innerHTML = "Back In " + hours + "H " +
    minutes + "M " + seconds + "S ";

  if (distance < 0) {

    clearInterval(this.timerinterval);
    document.getElementById("demo").innerHTML = "";
  }
}, 1000);
let countDownDate=new Date(返回_endate.toString()).getTime();
this.timerinterval=setInterval(()=>{
现在让我们=new Date().getTime();
让距离=倒计时日期-现在;
让天数=数学楼层(距离/(1000*60*60*24));
让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60));
分钟=数学楼层((距离%(1000*60*60))/(1000*60));
设秒数=数学楼层((距离%(1000*60))/1000);
日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天);
document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+
分钟+米+秒+秒;
如果(距离<0){
clearInterval(this.timerinterval);
document.getElementById(“demo”).innerHTML=“”;
}
}, 1000);

错误是使用关键字函数声明回调。改用这个:

let countDownDate = new Date(returned_endate.toString()).getTime();

this.timerinterval = setInterval(() => {

  let now = new Date().getTime();
  let distance = countDownDate - now;
  let days = Math.floor(distance / (1000 * 60 * 60 * 24));
  let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  let seconds = Math.floor((distance % (1000 * 60)) / 1000);
  console.log(now, "now", "countDownDate", countDownDate, "distance", distance, "days", days);
  document.getElementById("demo").innerHTML = "Back In " + hours + "H " +
    minutes + "M " + seconds + "S ";

  if (distance < 0) {

    clearInterval(this.timerinterval);
    document.getElementById("demo").innerHTML = "";
  }
}, 1000);
let countDownDate=new Date(返回_endate.toString()).getTime();
this.timerinterval=setInterval(()=>{
现在让我们=new Date().getTime();
让距离=倒计时日期-现在;
让天数=数学楼层(距离/(1000*60*60*24));
让小时数=数学楼层((距离%(1000*60*60*24))/(1000*60*60));
分钟=数学楼层((距离%(1000*60*60))/(1000*60));
设秒数=数学楼层((距离%(1000*60))/1000);
日志(现在,“现在”,“倒计时日期”,倒计时日期,“距离”,距离,“天”,天);
document.getElementById(“demo”).innerHTML=“返回”+hours+“H”+
分钟+米+秒+秒;
如果(距离<0){
clearInterval(this.timerinterval);
document.getElementById(“demo”).innerHTML=“”;
}
}, 1000);

请为您的问题添加更多解释并描述您的问题。请为您的问题添加更多解释并描述您的问题。