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 11< div class ="row ">
22 < 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 >
54 </ 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 >
87 </ div >
98</ div >
Original file line number Diff line number Diff line change @@ -11,14 +11,28 @@ export class ClockComponent implements OnInit {
1111 hour : number ;
1212 minutes : number ;
1313 seconds : number ;
14+ displayTime : boolean ;
1415
1516 constructor ( ) {
1617 this . currentDate = new Date ( ) ;
1718 this . hour = this . currentDate . getHours ( ) ;
1819 this . minutes = this . currentDate . getMinutes ( ) ;
1920 this . seconds = this . currentDate . getSeconds ( ) ;
21+ this . displayTime = false ;
22+ setTimeout ( ( ) => {
23+ this . displayTime = true ;
24+ } , 3000 ) ;
2025 }
2126
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+
2236
2337 ngOnInit ( ) : void {
2438 }
Original file line number Diff line number Diff line change 11< div class ="d-flex " id ="wrapper ">
2-
32 <!-- Sidebar -->
43 < div class ="bg-light border-right " id ="sidebar-wrapper ">
54 < div class ="list-group list-group-flush ">
You can’t perform that action at this time.
0 commit comments