diff --git a/src/app/showcase/app.component.spec.ts b/src/app/showcase/app.component.spec.ts index 569047ba132..12da82e2f19 100755 --- a/src/app/showcase/app.component.spec.ts +++ b/src/app/showcase/app.component.spec.ts @@ -5,7 +5,6 @@ import { FormsModule } from '@angular/forms'; import { AutoCompleteModule } from '../components/autocomplete/autocomplete'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppConfigComponent } from './app.config.component'; -import { JsonService } from './service/jsonservice'; import { AppConfigService } from './service/appconfigservice'; import { HttpClientModule } from '@angular/common/http'; import { AppTopBarComponent } from './app.topbar.component'; @@ -18,7 +17,7 @@ describe('AppComponent', () => { TestBed.configureTestingModule({ imports: [RouterTestingModule, FormsModule, BrowserAnimationsModule, AutoCompleteModule, HttpClientModule], declarations: [AppComponent, AppConfigComponent, AppTopBarComponent, AppMenuComponent, AppFooterComponent, AppInputStyleSwitchComponent], - providers: [JsonService, AppConfigService] + providers: [AppConfigService] }).compileComponents(); })); diff --git a/src/app/showcase/app.component.ts b/src/app/showcase/app.component.ts index 7c56e1a956f..648c9dd9eb4 100755 --- a/src/app/showcase/app.component.ts +++ b/src/app/showcase/app.component.ts @@ -1,9 +1,8 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; -import { environment } from 'src/environments/environment'; import { AppConfig } from './domain/appconfig'; import { AppConfigService } from './service/appconfigservice'; -import { JsonService } from './service/jsonservice'; +import Announcement from './data/news.json'; @Component({ selector: 'app-root', @@ -11,15 +10,15 @@ import { JsonService } from './service/jsonservice'; styleUrls: ['./app.component.css'] }) export class AppComponent implements OnInit, OnDestroy { - constructor(private configService: AppConfigService, private JsonService: JsonService) {} + constructor(private configService: AppConfigService) {} config: AppConfig; public subscription: Subscription; - public announcement: any; + public announcement: any = Announcement; - public newsActive: boolean = false; + public newsActive: boolean; storageKey = 'primeng'; @@ -32,21 +31,15 @@ export class AppComponent implements OnInit, OnDestroy { this.config = config; }); - /*if (environment.production) { - this.JsonService.getAnnouncement().then((data) => { - this.announcement = data; - - const itemString = localStorage.getItem(this.storageKey); - if (itemString) { - const item = JSON.parse(itemString); - if (item.hiddenNews && item.hiddenNews !== data.id) { - this.newsActive = true; - } - } else { - this.newsActive = true; - } - }); - }*/ + const itemString = localStorage.getItem(this.storageKey); + if (itemString) { + const item = JSON.parse(itemString); + if (item.hiddenNews && item.hiddenNews !== Announcement.id) { + this.newsActive = true; + } + } else { + this.newsActive = true; + } } onNewsClose() { diff --git a/src/app/showcase/app.menu.component.ts b/src/app/showcase/app.menu.component.ts index 31983368b26..0c88a036c99 100644 --- a/src/app/showcase/app.menu.component.ts +++ b/src/app/showcase/app.menu.component.ts @@ -64,7 +64,7 @@ declare let gtag: Function;
@@ -81,8 +81,8 @@ declare let gtag: Function; diff --git a/src/app/showcase/app.module.ts b/src/app/showcase/app.module.ts index 85f55a9e05e..3d7e66ad143 100755 --- a/src/app/showcase/app.module.ts +++ b/src/app/showcase/app.module.ts @@ -34,7 +34,6 @@ import { NodeService } from './service/nodeservice'; import { AppConfigService } from './service/appconfigservice'; import { CustomerService } from './service/customerservice'; import { IconService } from './service/iconservice'; -import { JsonService } from './service/jsonservice'; import { PhotoService } from './service/photoservice'; import { ProductService } from './service/productservice'; @@ -80,7 +79,7 @@ import { LandingComponent } from './components/landing/landing.component'; InputMaskModule, DropdownModule ], - providers: [{ provide: LocationStrategy, useClass: PathLocationStrategy }, CarService, CountryService, EventService, NodeService, IconService, CustomerService, PhotoService, JsonService, AppConfigService, ProductService], + providers: [{ provide: LocationStrategy, useClass: PathLocationStrategy }, CarService, CountryService, EventService, NodeService, IconService, CustomerService, PhotoService, AppConfigService, ProductService], bootstrap: [AppComponent] }) export class AppModule {} diff --git a/src/app/showcase/app.topbar.component.ts b/src/app/showcase/app.topbar.component.ts index c4bfb564ec4..087ad4c5e85 100644 --- a/src/app/showcase/app.topbar.component.ts +++ b/src/app/showcase/app.topbar.component.ts @@ -2,9 +2,9 @@ import { Component, EventEmitter, Output, ViewChild, ElementRef, Input, OnInit, import { trigger, style, transition, animate, AnimationEvent } from '@angular/animations'; import { Router, NavigationEnd } from '@angular/router'; import { AppConfigService } from './service/appconfigservice'; -import { JsonService } from './service/jsonservice'; import { AppConfig } from './domain/appconfig'; import { Subscription } from 'rxjs'; +import Versions from './data/versions.json'; @Component({ selector: 'app-topbar', @@ -28,7 +28,7 @@ import { Subscription } from 'rxjs'; Designer400+ ready to copy-paste UI blocks to build spectacular applications in no time.