From 2cf50c9e57aaed71244dd5f8b09de0fd88357c7e Mon Sep 17 00:00:00 2001 From: gucal Date: Wed, 11 Oct 2023 11:00:32 +0300 Subject: [PATCH] API Doc Cosmetics --- .../app.docapitable.component.html | 39 +++++++++++++------ .../docapitable/app.docapitable.component.ts | 25 ++++++++++-- 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/app/showcase/layout/doc/docapitable/app.docapitable.component.html b/src/app/showcase/layout/doc/docapitable/app.docapitable.component.html index 35020ce2009..40f56e39d21 100644 --- a/src/app/showcase/layout/doc/docapitable/app.docapitable.component.html +++ b/src/app/showcase/layout/doc/docapitable/app.docapitable.component.html @@ -19,24 +19,40 @@ - - - {{entry[1] || '-'}} - {{entry[1] || '-'}} + + + {{entry[1] || '-'}} + {{entry[1] || '-'}} - - {{entry[1].name}} : - {{i !== 0 ? ' |' : ' ' }} {{value || '-'}} +
+ {{entry[1].name}} + : + {{i !== 0 + ? ' |' : ' ' }} {{value || '-'}} - {{value}} + {{value}} - +
null
- {{entry[1]}} + {{ entry[1] }}
@@ -46,7 +62,8 @@ - +
diff --git a/src/app/showcase/layout/doc/docapitable/app.docapitable.component.ts b/src/app/showcase/layout/doc/docapitable/app.docapitable.component.ts index 83f3c71c6e7..1055ade09e3 100644 --- a/src/app/showcase/layout/doc/docapitable/app.docapitable.component.ts +++ b/src/app/showcase/layout/doc/docapitable/app.docapitable.component.ts @@ -1,6 +1,9 @@ +import { Location } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnInit, ViewContainerRef } from '@angular/core'; import { Router } from '@angular/router'; -import { Location } from '@angular/common'; +import { Subscription } from 'rxjs'; +import { AppConfig } from 'src/app/showcase/domain/appconfig'; +import { AppConfigService } from 'src/app/showcase/service/appconfigservice'; @Component({ selector: 'app-docapitable', @@ -29,9 +32,19 @@ export class AppDocApiTable implements OnInit { @Input() isInterface: boolean = false; - constructor(public viewContainerRef: ViewContainerRef, public router: Router, public location: Location) {} + config: AppConfig; + + subscription: Subscription; - ngOnInit() {} + constructor(public viewContainerRef: ViewContainerRef, public router: Router, public location: Location, public configService: AppConfigService) {} + + ngOnInit() { + this.config = this.configService.config; + + this.subscription = this.configService.configUpdate$.subscribe((config) => { + this.config = config; + }); + } navigate(event, param) { if (typeof window !== undefined) { @@ -106,4 +119,10 @@ export class AppDocApiTable implements OnInit { label && label.parentElement.scrollIntoView({ block: 'start', behavior: 'smooth' }); } } + + ngOnDestroy() { + if (this.subscription) { + this.subscription.unsubscribe(); + } + } }