From 425b5e9116a90e6835629c1741dd12806da473a1 Mon Sep 17 00:00:00 2001 From: Patrick Murimi Date: Thu, 22 Feb 2024 22:57:21 +0300 Subject: [PATCH] Revert "feat: Introduce signals" This reverts commit 4934a4ad0f4b07c959e044ea1a554a7e0219307e. --- .../main-content/main-content.component.html | 4 ++-- .../main-content/main-content.component.ts | 24 +++---------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/app/modules/blogs/main-content/main-content.component.html b/src/app/modules/blogs/main-content/main-content.component.html index ea610f1..a0b9079 100644 --- a/src/app/modules/blogs/main-content/main-content.component.html +++ b/src/app/modules/blogs/main-content/main-content.component.html @@ -1,5 +1,5 @@
- + - +
diff --git a/src/app/modules/blogs/main-content/main-content.component.ts b/src/app/modules/blogs/main-content/main-content.component.ts index 0b7848a..17d62b5 100644 --- a/src/app/modules/blogs/main-content/main-content.component.ts +++ b/src/app/modules/blogs/main-content/main-content.component.ts @@ -1,5 +1,4 @@ -import { Component, signal } from '@angular/core'; -// import { NgxPaginationModule } from 'ngx-pagination'; +import { Component, Input } from '@angular/core'; import { LatestBlogsComponent } from './latest-blogs/latest-blogs.component'; import { BlogsListComponent } from './blogs-list/blogs-list.component'; import { SearchBarComponent } from './search-bar/search-bar.component'; @@ -15,14 +14,8 @@ import { BlogModel } from '../../../models/blog.model'; styleUrl: './main-content.component.scss', }) export class MainContentComponent { - page: number = 1; - count: number = 0; - tableSize: number = 7; - tableSizes: any = [3, 6, 9, 12]; - loading: boolean = true; - blogs = signal([]); - filteredBlogs = signal([]); + blogs: BlogModel[] = []; constructor(private apollo: Apollo) {} @@ -37,22 +30,11 @@ export class MainContentComponent { }) .valueChanges.subscribe(({ data, error }: any) => { console.log(data); - this.blogs.set(data.blogs); - this.filteredBlogs.set(data.blogs); + this.blogs = data.blogs; this.loading = false; if (error) { console.error(error); } }); } - - // onTableDataChange(event: any) { - // this.page = event; - // this.loadBlogs(); - // } - // onTableSizeChange(event: any): void { - // this.tableSize = event.target.value; - // this.page = 1; - // this.loadBlogs(); - // } }