mirror of
https://github.com/jwetzell/itsfiveoclockwhere.git
synced 2026-08-09 09:13:41 +00:00
update to angular 21
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
<app-timezone-list
|
||||
*ngIf="fiveOclocks"
|
||||
[timezones]="fiveOclocks"
|
||||
[closest]="fiveOclock"
|
||||
[showAll]="showAll"
|
||||
(click)="toggleView()">
|
||||
</app-timezone-list>
|
||||
@if (fiveOclocks) {
|
||||
<app-timezone-list [timezones]="fiveOclocks" [closest]="fiveOclock" [showAll]="showAll" (click)="toggleView()">
|
||||
</app-timezone-list>
|
||||
}
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
[@displayState]="state"
|
||||
(@displayState.start)="animationEvent($event)"
|
||||
(@displayState.done)="animationEvent($event)">
|
||||
<ng-container *ngIf="showAllItems; else single">
|
||||
<div
|
||||
*ngFor="let timezone of timezones"
|
||||
class="container"
|
||||
[ngStyle]="{ height: timezones.length == 1 ? '100%' : 'auto' }">
|
||||
<h1 class="timezone">{{ timezone.name.replace('_', ' ') }}</h1>
|
||||
<h2 class="time">{{ timezone.time?.toFormat('tt') }}</h2>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-template #single>
|
||||
<div *ngIf="closest" class="single-container">
|
||||
<h1 class="timezone">{{ closest.name.replace('_', ' ') }}</h1>
|
||||
<h2 class="time">{{ closest.time?.toFormat('tt') }}</h2>
|
||||
</div>
|
||||
</ng-template>
|
||||
@if (showAllItems) {
|
||||
@for (timezone of timezones; track timezone) {
|
||||
<div class="container" [ngStyle]="{ height: timezones.length == 1 ? '100%' : 'auto' }">
|
||||
<h1 class="timezone">{{ timezone.name.replace('_', ' ') }}</h1>
|
||||
<h2 class="time">{{ timezone.time?.toFormat('tt') }}</h2>
|
||||
</div>
|
||||
}
|
||||
} @else {
|
||||
@if (closest) {
|
||||
<div class="single-container">
|
||||
<h1 class="timezone">{{ closest.name.replace('_', ' ') }}</h1>
|
||||
<h2 class="time">{{ closest.time?.toFormat('tt') }}</h2>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { enableProdMode, provideZoneChangeDetection } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
@@ -9,5 +9,5 @@ if (environment.production) {
|
||||
}
|
||||
|
||||
platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule)
|
||||
.bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] })
|
||||
.catch((err) => console.error(err));
|
||||
|
||||
Reference in New Issue
Block a user