code refactoring
This commit is contained in:
parent
f781ad43f4
commit
549444dd59
@ -14,7 +14,6 @@ export class AboutComponent extends BaseComponent<IAbout> implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
// this.init();
|
||||
this.getAbout();
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ const routes: Routes = [
|
||||
{ path: '', component: AboutComponent, title: "Bangara Raju" },
|
||||
{ path: 'resume', component: ResumeComponent, title: "Bangara Raju - Resume" },
|
||||
{ path: 'projects', component: ProjectsComponent, title: "Bangara Raju - Projects" },
|
||||
{ path: 'blog-posts', component: BlogComponent, title: "Bangara Raju - Posts" },
|
||||
{ path: 'weblog', component: BlogComponent, title: "Bangara Raju - Posts" },
|
||||
{ path: 'contact', component: ContactComponent, title: "Bangara Raju - Contact" }
|
||||
];
|
||||
|
||||
|
||||
@ -7,5 +7,5 @@ import { LoaderService } from './services/loader.service';
|
||||
styleUrls: ['./app.component.scss']
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor(public loaderSvc: LoaderService) {}
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
@ -10,14 +10,6 @@ export abstract class BaseComponent<T extends object> {
|
||||
constructor(public svc: CvService) {
|
||||
}
|
||||
|
||||
init(): void {
|
||||
this.svc.getCv(this.candidateId).subscribe((response) => {
|
||||
this.svc.resume = response;
|
||||
this.assignData(response);
|
||||
this.svc.baseSubject.next(response);
|
||||
});
|
||||
}
|
||||
|
||||
assignData(response: Partial<ICv> | unknown){
|
||||
Object.assign(this.model, response);
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ export class BlogComponent extends BaseComponent<IBlog> implements OnInit{
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
// this.init();
|
||||
this.getBlog();
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { AfterViewInit, Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { BaseComponent } from '../base/base.component';
|
||||
import { CvService } from '../services/cv.service';
|
||||
import { ISideBar } from './side-bar.model';
|
||||
import { ICv } from '../models/cv.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-contact-sidebar',
|
||||
@ -17,9 +16,6 @@ export class ContactSidebarComponent extends BaseComponent<ISideBar> implements
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
// this.svc.baseSubject.subscribe((resume: ICv | unknown) =>{
|
||||
// this.assignData(resume);
|
||||
// });
|
||||
this.getCandidateAndSocialLinks();
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
</li>
|
||||
|
||||
<li class="navbar-item">
|
||||
<button routerLink="/blog-posts" routerLinkActive="active" class="navbar-link" data-nav-link>Blog</button>
|
||||
<button routerLink="/weblog" routerLinkActive="active" class="navbar-link" data-nav-link>Blog</button>
|
||||
</li>
|
||||
|
||||
<li class="navbar-item">
|
||||
|
||||
@ -6,5 +6,4 @@ import { Component } from '@angular/core';
|
||||
styleUrl: './navbar.component.scss'
|
||||
})
|
||||
export class NavbarComponent {
|
||||
|
||||
}
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { BaseComponent } from '../base/base.component';
|
||||
import { CvService } from '../services/cv.service';
|
||||
import { IProjects } from './projects.model';
|
||||
import { IProject } from '../models/project.model';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { ICv } from '../models/cv.model';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
@ -22,10 +21,6 @@ categoryClicked: boolean = false;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
// this.subscription = this.svc.baseSubject.subscribe((resume: ICv | unknown) =>{
|
||||
// this.projects = this.model.projects;
|
||||
// });
|
||||
// this.init();
|
||||
this.getProjects();
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@ export class ResumeComponent extends BaseComponent<IResume> implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
// this.init();
|
||||
this.getResume();
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ import { Injectable } from '@angular/core';
|
||||
import { ICv } from '../models/cv.model';
|
||||
import { Observable, Subject, of } from 'rxjs';
|
||||
import { IAbout } from '../about/about.model';
|
||||
import { ISocialLinks } from '../models/social-links.model';
|
||||
import { IResume } from '../resume/resume.model';
|
||||
import { IBlog } from '../blog/blog.model';
|
||||
import { IProjects } from '../projects/projects.model';
|
||||
@ -21,7 +20,6 @@ export class CvService {
|
||||
public projects!: IProjects;
|
||||
public blog!: IBlog;
|
||||
|
||||
public baseSubject = new Subject();
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
getCv(candidateId: number): Observable<ICv> {
|
||||
|
||||
@ -404,7 +404,7 @@
|
||||
}
|
||||
|
||||
.contact-item {
|
||||
// min-width: 100%;
|
||||
min-width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user