Вキ
Size: a a a
KA
Вキ
Вキ
VC
startTimer(cancel?) {
let countdown = 30;
this.showTimer = true;
this.activeTimer = true;
this.timer$ = timer(0, 1000)
.pipe(
takeWhile(() => {
if (countdown === 0) {
this.showTimer = false;
this.activeTimer = false;
}
return countdown > 0;
}),
tap(() => countdown--),
map(() => countdown)
);
}
VC
<div class="timer" *ngIf="showTimer">Отправить код повторно можно через {{ timer$ | async }} сек.</div>
m
KA
m
Вキ
startTimer(cancel?) {
let countdown = 30;
this.showTimer = true;
this.activeTimer = true;
this.timer$ = timer(0, 1000)
.pipe(
takeWhile(() => {
if (countdown === 0) {
this.showTimer = false;
this.activeTimer = false;
}
return countdown > 0;
}),
tap(() => countdown--),
map(() => countdown)
);
}
Вキ
m
Вキ
VC
KA
Вキ
Вキ
АО
startTimer(cancel?) {
let countdown = 30;
this.showTimer = true;
this.activeTimer = true;
this.timer$ = timer(0, 1000)
.pipe(
takeWhile(() => {
if (countdown === 0) {
this.showTimer = false;
this.activeTimer = false;
}
return countdown > 0;
}),
tap(() => countdown--),
map(() => countdown)
);
}
Вキ
VC