Commit c36524ad1e1124663cdd2b7ab8185ad7366434e0
1 parent
4301149e16
Exists in
master
and in
1 other branch
Codigo identado.
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
src/app/components/master/master.component.ts
1 | import { Component, OnInit, OnDestroy } from '@angular/core'; | 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; |
2 | import { Router } from '@angular/router'; | 2 | import { Router } from '@angular/router'; |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'app-master', | 5 | selector: 'app-master', |
6 | templateUrl: './master.component.html', | 6 | templateUrl: './master.component.html', |
7 | styleUrls: ['./master.component.scss'] | 7 | styleUrls: ['./master.component.scss'] |
8 | }) | 8 | }) |
9 | export class MasterComponent implements OnInit, OnDestroy { | 9 | export class MasterComponent implements OnInit, OnDestroy { |
10 | 10 | ||
11 | private timerReposo: any | 11 | private timerReposo: any; |
12 | 12 | ||
13 | constructor( | 13 | constructor( |
14 | private router: Router | 14 | private router: Router |
15 | ) { } | 15 | ) { } |
16 | 16 | ||
17 | ngOnInit() { | 17 | ngOnInit() { |
18 | 18 | ||
19 | this.timerReposo = setTimeout(() => { | 19 | this.timerReposo = setTimeout(() => { |
20 | 20 | ||
21 | this.router.navigate(['cancelar-compra']); | 21 | this.router.navigate(['cancelar-compra']); |
22 | }, 90000) | 22 | }, 90000) |
23 | } | 23 | } |
24 | 24 | ||
25 | ngOnDestroy() { | 25 | ngOnDestroy() { |
26 | 26 | ||
27 | clearTimeout(this.timerReposo); | 27 | clearTimeout(this.timerReposo); |
28 | } | 28 | } |
29 | 29 | ||
30 | reiniciarTimer() { | 30 | reiniciarTimer() { |
31 | 31 | ||
32 | clearTimeout(this.timerReposo); | 32 | clearTimeout(this.timerReposo); |
33 | this.timerReposo = setTimeout(() => { | 33 | this.timerReposo = setTimeout(() => { |
34 | 34 | ||
35 | this.router.navigate(['cancelar-compra']); | 35 | this.router.navigate(['cancelar-compra']); |
36 | }, 90000) | 36 | }, 90000) |
37 | |||
38 | } | 37 | } |
39 | 38 | ||
40 | } | 39 | } |
41 | 40 |