diff --git a/angular-primeng-app/src/app/components/footer/footer.component.ts b/angular-primeng-app/src/app/components/footer/footer.component.ts index 16a3543..d885a51 100644 --- a/angular-primeng-app/src/app/components/footer/footer.component.ts +++ b/angular-primeng-app/src/app/components/footer/footer.component.ts @@ -1,8 +1,9 @@ -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { BlogService } from '../../services/blog.service'; import { Subscription } from 'rxjs'; import { ToolbarModule } from 'primeng/toolbar'; +import { BlogInfo } from '../../models/blog-info'; @Component({ selector: 'app-footer', @@ -12,17 +13,17 @@ import { ToolbarModule } from 'primeng/toolbar'; styleUrl: './footer.component.scss' }) export class FooterComponent { + blogURL!: string; + blogInfo!: BlogInfo; blogName = ''; - date = new Date().getFullYear(); + blogService: BlogService = inject(BlogService); private querySubscription?: Subscription; - constructor(private blogService: BlogService) { - } - ngOnInit() { - this.querySubscription = this.blogService.getBlogInfo() + this.blogURL = this.blogService.getBlogURL(); + this.querySubscription = this.blogService.getBlogInfo(this.blogURL) .subscribe((data) => this.blogName = data.title); } diff --git a/angular-primeng-app/src/app/components/header/header.component.html b/angular-primeng-app/src/app/components/header/header.component.html index 78cb8e3..cf00426 100644 --- a/angular-primeng-app/src/app/components/header/header.component.html +++ b/angular-primeng-app/src/app/components/header/header.component.html @@ -6,6 +6,7 @@
-
Sign in with Hashnode
- This blog is powered by Hashnode. To interact with the content on this blog, please log in through Hashnode.
-
+
Sign in with Hashnode
+ This blog is powered by Hashnode. To interact with the content on this blog, please log in through Hashnode.
+{{ post.publishedAt | date }}
-{{ post.publishedAt | date }}
+No matching articles found. Try another search
- } @else { -Search articles from this blog
- } + @if (queryFormControl.value) { +No matching articles found. Try another search
+ } @else { +Search articles from this blog
+ } }Blog URL changed and set in local storage
+Reload the page to see your content loading
+When resetting you may need to click on
+the logo image to load the content again
+try AnguHashBlog
+ with another Hashnode blog + +