diff --git a/web-angular/angular.json b/web-angular/angular.json index b8e0eaf6..78155bc4 100644 --- a/web-angular/angular.json +++ b/web-angular/angular.json @@ -199,8 +199,7 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "weather-forecast-today:build", - "proxyConfig": "proxy.conf.json" + "browserTarget": "weather-forecast-today:build" }, "configurations": { "production": { diff --git a/web-angular/projects/weather-forecast-today/src/app/app.module.ts b/web-angular/projects/weather-forecast-today/src/app/app.module.ts index d69f84c2..910780ad 100644 --- a/web-angular/projects/weather-forecast-today/src/app/app.module.ts +++ b/web-angular/projects/weather-forecast-today/src/app/app.module.ts @@ -40,8 +40,10 @@ import { * Computes the api domain from the browser location. */ const apidomain = (): { http: string, ws: string } => { - const host = document.location.hostname; - const port = document.location.port; + // const host = document.location.hostname; + const host = 'www.mowesta.com'; + // const port = document.location.port; + const port = ''; const protocol = document.location.protocol; let hostportpath = ''; if (port.length > 0) { @@ -112,7 +114,7 @@ export class AppModule {   ngDoBootstrap() {     const el = createCustomElement(WeatherForecastTodayComponent, { injector: this.injector }); -    // @ts-ignore + // @ts-ignore     customElements.define('weather-forecast-today', el);   } } diff --git a/web-angular/projects/weather-forecast-today/src/app/web-component/weather-forecast-today.component.ts b/web-angular/projects/weather-forecast-today/src/app/web-component/weather-forecast-today.component.ts index d8dfb44e..8689a2f8 100644 --- a/web-angular/projects/weather-forecast-today/src/app/web-component/weather-forecast-today.component.ts +++ b/web-angular/projects/weather-forecast-today/src/app/web-component/weather-forecast-today.component.ts @@ -79,7 +79,6 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked, (city: City) => { if (!this.noHeader) { this.setHeaderInfos(city); } const date = new Date(); - // if (this.tomorrow) { date.setDate(date.getDate() + 1); } const period = this.tomorrow ? ForecastPeriod.TOMORROW : ForecastPeriod.TODAY; const { dayForecasts, daytimeForecasts, error } = this.cityForecastService.fetchForecasts(city, date, period); this.forecast$ = this.dayTime ? daytimeForecasts : dayForecasts; @@ -142,8 +141,10 @@ export class WeatherForecastTodayComponent implements OnInit, AfterViewChecked, } private checkContainerSize(): void { - const outerDiv: HTMLDivElement = this.outer.nativeElement; - const innerDiv: HTMLDivElement = this.inner.nativeElement; + const outerDiv: HTMLDivElement = this.outer?.nativeElement; + const innerDiv: HTMLDivElement = this.inner?.nativeElement; + if (!outerDiv || !innerDiv) { return; } + if (this.dayTime) { // Needs to check container size due to multiple tiles. if (this.outerBrkPt2 < outerDiv.clientWidth && outerDiv.clientWidth <= this.outerBrkPt1) { diff --git a/web-angular/projects/weather-forecast-today/src/index.html b/web-angular/projects/weather-forecast-today/src/index.html index 8a8f01ff..27f15d56 100644 --- a/web-angular/projects/weather-forecast-today/src/index.html +++ b/web-angular/projects/weather-forecast-today/src/index.html @@ -7,6 +7,6 @@ - +