javascript - How to make timer circle to run according to timer entries -


i have timer, bounded circle. circle moves along running entries timer. if play circle move according seconds, if pause circle gets paused , stop means goes zero. if run timer , change page, timer circle go forward , backward. not running according number of seconds @ present.it taking 2 entries not getting issue arising. please hereby sharing codes please help:

html code:

<round-progress [current]="current" [max]="3600" [stroke]="6" [radius]="100" [rounded]="false" [responsive]="false" [color]="color" [background]="background" [duration]="800" [animation]="animation"></round-progress> 

track.ts

                this.apiservice                     .runningentries(this.user_id)                     .subscribe(                       entries  => {                        if(entries.current) {                          this.currenttask = entries.current;                          var milisecond = entries.current.ms;                          var second = parseint(milisecond) / 1000;                          this.current = parseint(second.tofixed(2))                          if(this.current < 0)                           {                           this.current = 0;                           }                          this.playpausestopunsubscribe.unsubscribe();                          var last = entries.current.times[entries.current.times.length - 1];                          if((last.state == 'start') || (last.state == 'resume')) {                            this.play = true;                          } else if(last.state == 'pause') {                            this.play = false;                          }                        }                     } 

time.ts

this.apiservice         .checklogin()         .subscribe(           user  => {             /*get running entries */               this.apiservice                 .runningentries(user.user._id)                 .subscribe(                     entries  => {                      if(entries.current) {                         var milisecond = entries.current.ms;                         var second = parseint(milisecond) / 1000;                         second = parseint(second.tofixed(2))                         this.start = second;                         var length = entries.current.times.length;                         var last_entry = entries.current.times[length - 1];                         if((last_entry.state == 'start') || (last_entry.state == 'resume')) {                            this.starttimer();                         } else if(last_entry.state == 'pause') {                            this.pauseinittimer();                          }                      }                  }, error =>{                     //console.log(error);                  });  


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -