From 3e80780fce64295e52850b60b583389a0561839f Mon Sep 17 00:00:00 2001 From: Bangara Raju Kottedi Date: Thu, 2 May 2024 00:27:52 +0530 Subject: [PATCH] sidebar candidate info not loading even after service is up --- src/app/base/base.component.ts | 3 +++ src/app/contact-sidebar/contact-sidebar.component.ts | 3 +++ src/app/services/cv.service.ts | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/app/base/base.component.ts b/src/app/base/base.component.ts index 178dd3b..b865eea 100644 --- a/src/app/base/base.component.ts +++ b/src/app/base/base.component.ts @@ -12,5 +12,8 @@ export abstract class BaseComponent { assignData(response: Partial | unknown){ Object.assign(this.model, response); + if(this.svc.candidateAndSocialLinks == null){ + this.svc.getCandidateInfoSubject.next(""); + } } } \ No newline at end of file diff --git a/src/app/contact-sidebar/contact-sidebar.component.ts b/src/app/contact-sidebar/contact-sidebar.component.ts index abaea20..462a9f5 100644 --- a/src/app/contact-sidebar/contact-sidebar.component.ts +++ b/src/app/contact-sidebar/contact-sidebar.component.ts @@ -16,6 +16,9 @@ export class ContactSidebarComponent extends BaseComponent implements } ngOnInit(): void { + this.svc.getCandidateInfoSubject.subscribe(() => { + this.getCandidateAndSocialLinks(); + }); this.getCandidateAndSocialLinks(); } diff --git a/src/app/services/cv.service.ts b/src/app/services/cv.service.ts index a7f86d3..413ba56 100644 --- a/src/app/services/cv.service.ts +++ b/src/app/services/cv.service.ts @@ -13,6 +13,8 @@ import { IContact } from '../contact/contact.model'; providedIn: 'root' }) export class CvService { + public getCandidateInfoSubject = new Subject(); + public cv!: ICv; public about!: IAbout;