angular - Delay for router in Angular2 -
i have code, have 2 functions: say()
play music (is implemented , works) , router
leads next page (it works also)
go_next() { this.say(); // audio this.router.navigate( ['app'], { queryparams: { 'part': this.part+1 } } ); //go next page }
but play music (it takes 5 sec) , go next page...how implement this?..i guess, have implement kind of delay
, can't find such parameter router.navigate
.
settimeout(function, milliseconds) executes function, after waiting specified number of milliseconds.
go_next(){ settimeout(() => { this.router.navigate(['app'], {queryparams: {'part': this.part + 1}}) } , 5000); }
Comments
Post a Comment