code refactoring

This commit is contained in:
2024-05-06 23:20:51 +05:30
parent fd43f9c1e6
commit fe79623464
10 changed files with 17 additions and 10 deletions
+2 -2
View File
@@ -12,13 +12,13 @@
<a [href]="post.postUrl" target="_blank">
<figure class="blog-banner-box" *ngIf="post.image">
<img src="{{blogImageUrl + post.image}}" [alt]="post.title" loading="lazy">
<img src="{{blogUrl + post.image}}" [alt]="post.title" loading="lazy">
</figure>
<div class="blog-content">
<div class="blog-meta">
<p class="blog-category">{{post.categories}}</p>
<p class="blog-category" *ngFor="let category of post.categories; index as i">{{post.categories.length - i > 1 ? category + ',' : category}}</p>
<span class="dot"></span>
+2 -1
View File
@@ -10,7 +10,7 @@ import { environment } from 'src/environments/environment';
styleUrl: './blog.component.scss'
})
export class BlogComponent extends BaseComponent<IBlog> implements OnInit{
blogImageUrl: string = environment.blogImagesUrl;
blogUrl!: string;
constructor(svc: CvService){
super(svc);
}
@@ -23,6 +23,7 @@ export class BlogComponent extends BaseComponent<IBlog> implements OnInit{
this.svc.getBlog(this.candidateId).subscribe((response: IBlog) => {
this.svc.blog = this.svc.blog ?? response;
this.assignData(response);
this.blogUrl = this.svc.blog.blogUrl;
});
}
}
+1
View File
@@ -1,5 +1,6 @@
import { IPost } from "../models/post.model";
export interface IBlog{
blogUrl: string;
posts: IPost[];
}