File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
src/app/components/shared Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
< div class ="row ">
2
2
< div class ="col mt-1 time-clock-color ">
3
- <!-- fa fa-spin -->
4
- < i class ="fas fa-sync-alt "> </ i >
3
+ < i *ngIf ="!displayTime " class ="fas fa-sync-alt fa fa-spin "> </ i >
5
4
</ div >
6
- < div class ="col time-clock-color ">
7
- < h3 > {{ hour | number }}:{{ minutes | number }}:{{ seconds | number }}</ h3 >
5
+ < div *ngIf =" displayTime " class ="col time-clock-color ">
6
+ < h3 > {{ hour | number: '2.0-2' }}:{{ minutes | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }}</ h3 >
8
7
</ div >
9
8
</ div >
Original file line number Diff line number Diff line change @@ -11,14 +11,28 @@ export class ClockComponent implements OnInit {
11
11
hour : number ;
12
12
minutes : number ;
13
13
seconds : number ;
14
+ displayTime : boolean ;
14
15
15
16
constructor ( ) {
16
17
this . currentDate = new Date ( ) ;
17
18
this . hour = this . currentDate . getHours ( ) ;
18
19
this . minutes = this . currentDate . getMinutes ( ) ;
19
20
this . seconds = this . currentDate . getSeconds ( ) ;
21
+ this . displayTime = false ;
22
+ setTimeout ( ( ) => {
23
+ this . displayTime = true ;
24
+ } , 3000 ) ;
20
25
}
21
26
27
+ horatTest ( ) {
28
+ this . currentDate = new Date ( ) ;
29
+ this . hour = this . currentDate . getHours ( ) ;
30
+ this . minutes = this . currentDate . getMinutes ( ) ;
31
+ this . seconds = this . currentDate . getSeconds ( ) ;
32
+ this . displayTime = false ;
33
+ setTimeout ( 'horatTest()' , 3000 ) ;
34
+ }
35
+
22
36
23
37
ngOnInit ( ) : void {
24
38
}
Original file line number Diff line number Diff line change 1
1
< div class ="d-flex " id ="wrapper ">
2
-
3
2
<!-- Sidebar -->
4
3
< div class ="bg-light border-right " id ="sidebar-wrapper ">
5
4
< div class ="list-group list-group-flush ">
You can’t perform that action at this time.
0 commit comments