diff --git a/db.json b/db.json
index 23a7ffe..eb77770 100644
--- a/db.json
+++ b/db.json
@@ -4,12 +4,11 @@
"id": 1,
"password": "hoang",
"email": "lele9h0st@gmail.com",
- "phone": "0971280168",
+ "phone": "0987654321",
"name": "Trần Huy Hoàng",
- "address": "123/4 Thủ Đức Thành phố Hồ Chí Minh",
- "dateBirth": "2001-07-12",
- "gender": "male",
- "comfirmToken": "ok"
+ "address": "dia chi",
+ "dateBirth": "2001-08-27",
+ "gender": "male"
},
{
"email": "hoang@gmail.com",
@@ -109,6 +108,13 @@
"fullname": "Nguyễn Văn Hiếu",
"content": "cau mong chau doan tu voi gia dinh 🤷♀️",
"id": 12
+ },
+ {
+ "article_id": 2051473,
+ "email": "lele9h0st@gmail.com",
+ "fullname": "Trần Huy Hoàng",
+ "content": "tiểu vương quốc thanh hóa",
+ "id": 13
}
]
}
\ No newline at end of file
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 5c08fcf..ef530ab 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -59,9 +59,12 @@ import { PostModule } from './post/post.module';
import { ProfileModule } from "./profile/profile.module";
import { SharedModule } from './shared/shared.module';
import { SafeHtmlPipe } from './_pipes/safe-html.pipe';
+import { SubPostsComponent } from './pages/home/sub-posts/sub-posts.component';
+import { SubNewComponent } from './pages/home/sub-new/sub-new.component';
+import { SubHotComponent } from './pages/home/sub-hot/sub-hot.component';
@NgModule({
- declarations: [AppComponent, HomeComponent, NotfoundComponent, ContactComponent, SafeHtmlPipe],
+ declarations: [AppComponent, HomeComponent, NotfoundComponent, ContactComponent, SafeHtmlPipe, SubPostsComponent, SubNewComponent, SubHotComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
@@ -117,11 +120,13 @@ import { SafeHtmlPipe } from './_pipes/safe-html.pipe';
SharedModule,
PostModule,
AuthModule,
- ToastNoAnimationModule.forRoot({
+ ToastNoAnimationModule.forRoot({
timeOut: 1500,
positionClass: 'toast-top-right',
preventDuplicates: true,
- }),
+ easing: "ease-in",
+ easeTime: 1500
+ }),
],
providers: [MdbCookiesManagementService, MdbStorageManagementService],
bootstrap: [AppComponent],
diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html
index 620bdf7..bf47263 100644
--- a/src/app/pages/home/home.component.html
+++ b/src/app/pages/home/home.component.html
@@ -65,191 +65,35 @@
{{item.title}}
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/app/pages/home/home.component.scss b/src/app/pages/home/home.component.scss
index dd529e2..0ed20cd 100644
--- a/src/app/pages/home/home.component.scss
+++ b/src/app/pages/home/home.component.scss
@@ -101,46 +101,3 @@
}
}
}
-
-#overlay {
- position: fixed;
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: black;
- z-index: 1001;
- cursor: pointer;
-}
-
-.circle-loading {
- width: 7rem;
- height: 7rem;
- border-radius: 15rem;
- position: relative;
- top: 40%;
- margin: 0 auto;
- --color: #ff4081;
-}
-
-.circle-loading:before {
- content: "";
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- border-radius: inherit;
- border: 1rem solid transparent;
- border-right-color: var(--color);
- border-bottom-color: var(--color);
- animation: circleLoading 1s forwards infinite linear;
-}
-
-@keyframes circleLoading {
- to {
- transform: rotate(360deg);
- }
-}
diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts
index e811d08..672e705 100644
--- a/src/app/pages/home/home.component.ts
+++ b/src/app/pages/home/home.component.ts
@@ -57,32 +57,18 @@ export class HomeComponent implements OnInit {
var singleQuote = curr.title[0].trim().split("'").join("'");
var andSymbol = singleQuote.split("&").join("&");
var finalTitle = andSymbol;
-
+ var imgUrl = curr['media:content'][0]?.$.url;
let currentItem: Article = {
category: curr.category[0].trim(),
description: curr.description[0].trim(),
- guid: curr.guid[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- link: curr.link[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- media: "",
+ guid: curr.guid[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ link: curr.link[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ media: imgUrl,
pubDate: curr.pubDate[0].trim(),
title: finalTitle
};
-
- Object.keys(curr).forEach(function (key, index) {
- var article = curr[key];
- if (index === 6) {
- var url = article[0]?.$;
- Object.keys(url).forEach(function (key, index) {
- if (index === 2) {
- currentItem.media = url[key];
- return;
- }
- });
- }
- });
this.article_list.push(currentItem);
});
- console.log(this.article_list);
});
}
@@ -96,29 +82,16 @@ export class HomeComponent implements OnInit {
var singleQuote = curr.title[0].trim().split("'").join("'");
var andSymbol = singleQuote.split("&").join("&");
var finalTitle = andSymbol;
-
+ var imgUrl = curr['media:content'][0]?.$.url;
let currentItem: Article = {
category: curr.category[0].trim(),
description: curr.description[0].trim(),
- guid: curr.guid[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- link: curr.link[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- media: "",
+ guid: curr.guid[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ link: curr.link[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ media: imgUrl,
pubDate: curr.pubDate[0].trim(),
title: finalTitle
};
-
- Object.keys(curr).forEach(function (key, index) {
- var article = curr[key];
- if (index === 6) {
- var url = article[0]?.$;
- Object.keys(url).forEach(function (key, index) {
- if (index === 2) {
- currentItem.media = url[key];
- return;
- }
- });
- }
- });
this.ts_news.push(currentItem);
});
});
@@ -134,29 +107,17 @@ export class HomeComponent implements OnInit {
var singleQuote = curr.title[0].trim().split("'").join("'");
var andSymbol = singleQuote.split("&").join("&");
var finalTitle = andSymbol;
-
+ var imgUrl = curr['media:content'][0]?.$.url;
let currentItem: Article = {
category: curr.category[0].trim(),
description: curr.description[0].trim(),
- guid: curr.guid[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- link: curr.link[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- media: "",
+ guid: curr.guid[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ link: curr.link[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ media: imgUrl,
pubDate: curr.pubDate[0].trim(),
title: finalTitle
};
- Object.keys(curr).forEach(function (key, index) {
- var article = curr[key];
- if (index === 6) {
- var url = article[0]?.$;
- Object.keys(url).forEach(function (key, index) {
- if (index === 2) {
- currentItem.media = url[key];
- return;
- }
- });
- }
- });
this.tech_news.push(currentItem);
});
});
@@ -172,29 +133,16 @@ export class HomeComponent implements OnInit {
var singleQuote = curr.title[0].trim().split("'").join("'");
var andSymbol = singleQuote.split("&").join("&");
var finalTitle = andSymbol;
-
+ var imgUrl = curr['media:content'][0]?.$.url;
let currentItem: Article = {
category: curr.category[0].trim(),
description: curr.description[0].trim(),
- guid: curr.guid[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- link: curr.link[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- media: "",
+ guid: curr.guid[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ link: curr.link[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ media: imgUrl,
pubDate: curr.pubDate[0].trim(),
title: finalTitle
};
-
- Object.keys(curr).forEach(function (key, index) {
- var article = curr[key];
- if (index === 6) {
- var url = article[0]?.$;
- Object.keys(url).forEach(function (key, index) {
- if (index === 2) {
- currentItem.media = url[key];
- return;
- }
- });
- }
- });
this.business_news.push(currentItem);
});
});
@@ -210,29 +158,16 @@ export class HomeComponent implements OnInit {
var singleQuote = curr.title[0].trim().split("'").join("'");
var andSymbol = singleQuote.split("&").join("&");
var finalTitle = andSymbol;
-
+ var imgUrl = curr['media:content'][0]?.$.url;
let currentItem: Article = {
category: curr.category[0].trim(),
description: curr.description[0].trim(),
- guid: curr.guid[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- link: curr.link[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- media: "",
+ guid: curr.guid[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ link: curr.link[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ media: imgUrl,
pubDate: curr.pubDate[0].trim(),
title: finalTitle
};
-
- Object.keys(curr).forEach(function (key, index) {
- var article = curr[key];
- if (index === 6) {
- var url = article[0]?.$;
- Object.keys(url).forEach(function (key, index) {
- if (index === 2) {
- currentItem.media = url[key];
- return;
- }
- });
- }
- });
this.world_news.push(currentItem);
});
});
@@ -248,29 +183,16 @@ export class HomeComponent implements OnInit {
var singleQuote = curr.title[0].trim().split("'").join("'");
var andSymbol = singleQuote.split("&").join("&");
var finalTitle = andSymbol;
-
+ var imgUrl = curr['media:content'][0]?.$.url;
let currentItem: Article = {
category: curr.category[0].trim(),
description: curr.description[0].trim(),
- guid: curr.guid[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- link: curr.link[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- media: "",
+ guid: curr.guid[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ link: curr.link[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ media: imgUrl,
pubDate: curr.pubDate[0].trim(),
title: finalTitle
};
-
- Object.keys(curr).forEach(function (key, index) {
- var article = curr[key];
- if (index === 6) {
- var url = article[0]?.$;
- Object.keys(url).forEach(function (key, index) {
- if (index === 2) {
- currentItem.media = url[key];
- return;
- }
- });
- }
- });
this.sport_news.push(currentItem);
});
});
@@ -279,41 +201,29 @@ export class HomeComponent implements OnInit {
load_education_news() {
this.postService.get_list("giao-duc").subscribe((res: ArticleResponse) => {
var items = res.item;
-
Object.entries(items).map(([key, value]) => {
var curr: any = value;
var singleQuote = curr.title[0].trim().split("'").join("'");
var andSymbol = singleQuote.split("&").join("&");
var finalTitle = andSymbol;
+ var imgUrl = curr['media:content'][0]?.$.url;
let currentItem: Article = {
category: curr.category[0].trim(),
description: curr.description[0].trim(),
- guid: curr.guid[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- link: curr.link[0].trim().replace("https://vietnamnet.vn/","bai-viet/"),
- media: "",
+ guid: curr.guid[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ link: curr.link[0].trim().replace("https://vietnamnet.vn/", "bai-viet/"),
+ media: imgUrl,
pubDate: curr.pubDate[0].trim(),
title: finalTitle
};
-
- Object.keys(curr).forEach(function (key, index) {
- var article = curr[key];
- if (index === 6) {
- var url = article[0]?.$;
- Object.keys(url).forEach(function (key, index) {
- if (index === 2) {
- currentItem.media = url[key];
- return;
- }
- });
- }
- });
this.education_news.push(currentItem);
});
// this.isLoading = false;
// uncomment de hien modal
});
+ //xoa de hien modal
this.isLoading = false;
}
diff --git a/src/app/pages/home/sub-hot/sub-hot.component.html b/src/app/pages/home/sub-hot/sub-hot.component.html
new file mode 100644
index 0000000..4cc3821
--- /dev/null
+++ b/src/app/pages/home/sub-hot/sub-hot.component.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/pages/home/sub-hot/sub-hot.component.scss b/src/app/pages/home/sub-hot/sub-hot.component.scss
new file mode 100644
index 0000000..01cdb8c
--- /dev/null
+++ b/src/app/pages/home/sub-hot/sub-hot.component.scss
@@ -0,0 +1,9 @@
+.news-title {
+ color: black;
+ text-decoration: none;
+ font-weight: bold;
+}
+.news-title:hover {
+ text-decoration: underline;
+ color: black;
+}
diff --git a/src/app/pages/home/sub-hot/sub-hot.component.spec.ts b/src/app/pages/home/sub-hot/sub-hot.component.spec.ts
new file mode 100644
index 0000000..923ef4a
--- /dev/null
+++ b/src/app/pages/home/sub-hot/sub-hot.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SubHotComponent } from './sub-hot.component';
+
+describe('SubHotComponent', () => {
+ let component: SubHotComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ SubHotComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SubHotComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/pages/home/sub-hot/sub-hot.component.ts b/src/app/pages/home/sub-hot/sub-hot.component.ts
new file mode 100644
index 0000000..ddb2849
--- /dev/null
+++ b/src/app/pages/home/sub-hot/sub-hot.component.ts
@@ -0,0 +1,16 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { Article } from 'src/app/_model/post.model';
+
+@Component({
+ selector: 'sub-hot',
+ templateUrl: './sub-hot.component.html',
+ styleUrls: ['./sub-hot.component.scss']
+})
+export class SubHotComponent implements OnInit {
+ @Input() posts!: Article[];
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/pages/home/sub-new/sub-new.component.html b/src/app/pages/home/sub-new/sub-new.component.html
new file mode 100644
index 0000000..9494e1d
--- /dev/null
+++ b/src/app/pages/home/sub-new/sub-new.component.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/pages/home/sub-new/sub-new.component.scss b/src/app/pages/home/sub-new/sub-new.component.scss
new file mode 100644
index 0000000..3c740f8
--- /dev/null
+++ b/src/app/pages/home/sub-new/sub-new.component.scss
@@ -0,0 +1,12 @@
+.news-title {
+ color: black;
+ text-decoration: none;
+ font-weight: bold;
+}
+.news-title:hover {
+ text-decoration: underline;
+ color: black;
+}
+.middle__title {
+ margin: auto 20px;
+}
diff --git a/src/app/pages/home/sub-new/sub-new.component.spec.ts b/src/app/pages/home/sub-new/sub-new.component.spec.ts
new file mode 100644
index 0000000..13c66f4
--- /dev/null
+++ b/src/app/pages/home/sub-new/sub-new.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SubNewComponent } from './sub-new.component';
+
+describe('SubNewComponent', () => {
+ let component: SubNewComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ SubNewComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SubNewComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/pages/home/sub-new/sub-new.component.ts b/src/app/pages/home/sub-new/sub-new.component.ts
new file mode 100644
index 0000000..cbee472
--- /dev/null
+++ b/src/app/pages/home/sub-new/sub-new.component.ts
@@ -0,0 +1,22 @@
+import { Component, Input, OnInit } from '@angular/core';
+import slugify from 'slugify';
+import { Article } from 'src/app/_model/post.model';
+
+@Component({
+ selector: 'sub-new',
+ templateUrl: './sub-new.component.html',
+ styleUrls: ['./sub-new.component.scss']
+})
+export class SubNewComponent implements OnInit {
+ @Input() posts !: Article[];
+ @Input() title = '';
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+ get_slug(titleName: string) {
+ var slug = slugify(titleName.toLowerCase()).replace("dj", "d")
+ return slug;
+ }
+}
diff --git a/src/app/pages/home/sub-posts/sub-posts.component.html b/src/app/pages/home/sub-posts/sub-posts.component.html
new file mode 100644
index 0000000..4cca5fd
--- /dev/null
+++ b/src/app/pages/home/sub-posts/sub-posts.component.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/pages/home/sub-posts/sub-posts.component.scss b/src/app/pages/home/sub-posts/sub-posts.component.scss
new file mode 100644
index 0000000..522a972
--- /dev/null
+++ b/src/app/pages/home/sub-posts/sub-posts.component.scss
@@ -0,0 +1,42 @@
+.sub__posts {
+ background-color: #eeeeee;
+ .col-md-3 {
+ .row {
+ img {
+ height: 140px;
+ }
+ }
+ }
+}
+
+.img__sub {
+ width: 200px;
+ height: 134px;
+ object-fit: cover;
+}
+
+@media only screen and (max-width: 768px) {
+ .img__sub {
+ width: 100%;
+ height: auto;
+ }
+ .sub__posts {
+ .col-md-3 {
+ .row {
+ img {
+ width: 100% !important;
+ }
+ }
+ }
+ }
+}
+
+.news-title {
+ color: black;
+ text-decoration: none;
+ font-weight: bold;
+ &:hover {
+ text-decoration: underline;
+ color: black;
+ }
+}
diff --git a/src/app/pages/home/sub-posts/sub-posts.component.spec.ts b/src/app/pages/home/sub-posts/sub-posts.component.spec.ts
new file mode 100644
index 0000000..3b273b7
--- /dev/null
+++ b/src/app/pages/home/sub-posts/sub-posts.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SubPostsComponent } from './sub-posts.component';
+
+describe('SubPostsComponent', () => {
+ let component: SubPostsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ SubPostsComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SubPostsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/pages/home/sub-posts/sub-posts.component.ts b/src/app/pages/home/sub-posts/sub-posts.component.ts
new file mode 100644
index 0000000..7827e8a
--- /dev/null
+++ b/src/app/pages/home/sub-posts/sub-posts.component.ts
@@ -0,0 +1,16 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { Article } from 'src/app/_model/post.model';
+
+@Component({
+ selector: 'sub-posts',
+ templateUrl: './sub-posts.component.html',
+ styleUrls: ['./sub-posts.component.scss']
+})
+export class SubPostsComponent implements OnInit {
+ @Input() subPosts!: Article[];
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/post/advertisement/advertisement.component.html b/src/app/post/advertisement/advertisement.component.html
index 0681349..537e059 100644
--- a/src/app/post/advertisement/advertisement.component.html
+++ b/src/app/post/advertisement/advertisement.component.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/app/post/advertisement/advertisement.component.ts b/src/app/post/advertisement/advertisement.component.ts
index 199305a..84c878c 100644
--- a/src/app/post/advertisement/advertisement.component.ts
+++ b/src/app/post/advertisement/advertisement.component.ts
@@ -7,6 +7,7 @@ import { Component, Input, OnInit } from '@angular/core';
})
export class AdvertisementComponent implements OnInit {
@Input() url = '';
+ @Input() ref = '';
constructor() { }
ngOnInit(): void {
diff --git a/src/app/post/post-comment/post-comment.component.html b/src/app/post/post-comment/post-comment.component.html
new file mode 100644
index 0000000..096ecc0
--- /dev/null
+++ b/src/app/post/post-comment/post-comment.component.html
@@ -0,0 +1,17 @@
+
+
+
+
+
{{comment?.fullname?.charAt(0)}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/post/post-comment/post-comment.component.scss b/src/app/post/post-comment/post-comment.component.scss
new file mode 100644
index 0000000..ee11bde
--- /dev/null
+++ b/src/app/post/post-comment/post-comment.component.scss
@@ -0,0 +1,8 @@
+.cmt__content {
+ margin-left: 3rem;
+}
+@media only screen and (max-width: 768px) {
+ .user__avatar {
+ width: 60px;
+ }
+}
diff --git a/src/app/post/test-post-comment/test-post-comment.component.spec.ts b/src/app/post/post-comment/post-comment.component.spec.ts
similarity index 51%
rename from src/app/post/test-post-comment/test-post-comment.component.spec.ts
rename to src/app/post/post-comment/post-comment.component.spec.ts
index ab6ffd0..4f1ba36 100644
--- a/src/app/post/test-post-comment/test-post-comment.component.spec.ts
+++ b/src/app/post/post-comment/post-comment.component.spec.ts
@@ -1,20 +1,20 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { TestPostCommentComponent } from './test-post-comment.component';
+import { PostCommentComponent } from './post-comment.component';
-describe('TestPostCommentComponent', () => {
- let component: TestPostCommentComponent;
- let fixture: ComponentFixture;
+describe('PostCommentComponent', () => {
+ let component: PostCommentComponent;
+ let fixture: ComponentFixture;
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [ TestPostCommentComponent ]
+ declarations: [ PostCommentComponent ]
})
.compileComponents();
});
beforeEach(() => {
- fixture = TestBed.createComponent(TestPostCommentComponent);
+ fixture = TestBed.createComponent(PostCommentComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
diff --git a/src/app/post/post-comment/post-comment.component.ts b/src/app/post/post-comment/post-comment.component.ts
new file mode 100644
index 0000000..3166e05
--- /dev/null
+++ b/src/app/post/post-comment/post-comment.component.ts
@@ -0,0 +1,16 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { Comment } from "src/app/_model/comment.model";
+
+@Component({
+ selector: 'post-comment',
+ templateUrl: './post-comment.component.html',
+ styleUrls: ['./post-comment.component.scss']
+})
+export class PostCommentComponent implements OnInit {
+ @Input() comment!: Comment;
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/post/post-details/post-details.component.html b/src/app/post/post-details/post-details.component.html
index 17ba565..b1c5ef4 100644
--- a/src/app/post/post-details/post-details.component.html
+++ b/src/app/post/post-details/post-details.component.html
@@ -15,8 +15,9 @@ Bình luận
-
-
-
-
-
-
-
-
data news
-
-
\ No newline at end of file
diff --git a/src/app/post/test-post-comment/test-post-comment.component.scss b/src/app/post/test-post-comment/test-post-comment.component.scss
deleted file mode 100644
index 2a67727..0000000
--- a/src/app/post/test-post-comment/test-post-comment.component.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.green {
- color: green;
-}
-@media only screen and (max-width: 768px) {
- .post_details {
- width: 100% !important;
- }
-}
diff --git a/src/app/post/test-post-comment/test-post-comment.component.ts b/src/app/post/test-post-comment/test-post-comment.component.ts
deleted file mode 100644
index f282562..0000000
--- a/src/app/post/test-post-comment/test-post-comment.component.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
-import { PostService } from '../post.service';
-import { Comment } from "../../_model/comment.model";
-import { Cheerio, load } from 'cheerio'
-import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
-
-declare var $: any;
-
-@Component({
- selector: 'app-test-post-comment',
- templateUrl: './test-post-comment.component.html',
- styleUrls: ['./test-post-comment.component.scss']
-})
-export class TestPostCommentComponent implements OnInit {
-
- public testForm!: FormGroup;
- comments_list!: Comment[];
- post_details!: any;
-
- constructor(private formBuilder: FormBuilder, private service: PostService, private domSanitizer: DomSanitizer) {
- this.comments_list = [];
- }
-
- ngOnInit(): void {
- this.testForm = this.formBuilder.group({
- article_id: new FormControl('', [Validators.required]),
- email: new FormControl('', [Validators.email, Validators.required]),
- fullname: new FormControl('', [Validators.required]),
- content: new FormControl('', [Validators.required]),
- });
- this.get_data();
- }
-
-
- sanitize(html: any): SafeHtml {
- return this.domSanitizer.bypassSecurityTrustHtml(html);
- }
-
- get_data() {
- this.service.get_news_details("cuu-thu-tuong-ehud-barak-israel-tim-moi-cach-de-phat-hien-cham-soc-tung-nhan-tai-2049939.html").subscribe(res => {
- const $dom = load(res);
- $dom(".newsFeature__header-title").addClass("green");
- $dom(".newsFeature__boxAuthor").remove();
- $dom(".controll__box").remove();
- $dom(".vnn-template-noneditable").remove();
- $dom("table").remove();
- $dom("head").append('');
- this.post_details = this.sanitize($dom.html());
- console.log($dom.html())
- });
- }
-
-
- testlog() {
- alert("awda");
- }
-
- postComment() {
- console.log(this.testForm.value)
- this.service.post_comment(this.testForm.value).subscribe(res => {
- console.log(res);
- });
- }
-
- get_cmt() {
- var s = $("input[name='aid']").val();
- this.get_comment(s);
- }
-
- get_comment(id: number) {
- this.service.get_comments_by_post_id(id).subscribe(res => {
- this.comments_list = res;
- console.log(res);
- });
- }
-
-}
diff --git a/src/assets/css/style.css b/src/assets/css/style.css
index f531c9b..ba5c772 100644
--- a/src/assets/css/style.css
+++ b/src/assets/css/style.css
@@ -1,5 +1,6 @@
.newsFeature__header-title {
font-weight: bold;
+ color:black;
}
.newsFeature__main img {
@@ -14,6 +15,11 @@
margin-top: 1.5rem;
}
-iframe{
+iframe {
width: 100%;
-}
\ No newline at end of file
+}
+
+.video-detail__text h1 {
+ font-weight: bold;
+ color: black;
+}
diff --git a/src/styles.scss b/src/styles.scss
index c133f8b..c1a5800 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -36,6 +36,7 @@
@import "~mdb-angular-ui-kit/assets/scss/mdb.scss";
@import "./assets/css/nice-select.css";
@import '~ngx-toastr/toastr';
+
* {
font-family: Arial, Helvetica, sans-serif;
}
{{item?.content}}
-