From 10d2f78de0764d301a6901e32f5aabe088830f78 Mon Sep 17 00:00:00 2001 From: kj1352 Date: Sat, 17 Apr 2021 14:35:07 +0530 Subject: [PATCH] FB comment integration --- src/app/home-details/home-details.page.html | 8 ++++++ src/app/home-details/home-details.page.ts | 30 +++++++++++++++------ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/app/home-details/home-details.page.html b/src/app/home-details/home-details.page.html index 49fa3fc..498af74 100644 --- a/src/app/home-details/home-details.page.html +++ b/src/app/home-details/home-details.page.html @@ -31,6 +31,14 @@
+ + + + +
+
diff --git a/src/app/home-details/home-details.page.ts b/src/app/home-details/home-details.page.ts index c890177..3013098 100644 --- a/src/app/home-details/home-details.page.ts +++ b/src/app/home-details/home-details.page.ts @@ -16,6 +16,7 @@ export class HomeDetailsPage implements OnInit { myComment: string = ''; image_url = IMAGE_BASE_URL; newsDetails: any = {}; + alias_title: string = ''; constructor( private route: ActivatedRoute, @@ -40,16 +41,13 @@ export class HomeDetailsPage implements OnInit { } ngOnInit() { - let alias_title = this.route.snapshot.paramMap.get('alias_title'); + this.alias_title = this.route.snapshot.paramMap.get('alias_title'); let type = this.route.snapshot.paramMap.get('type'); // type 'news' | 'videos' | 'gallery' - - console.log(alias_title); - console.log(type); - + if (type === 'news') { - this.newsService.getArticleDetails(alias_title).then((data: any) => { + this.newsService.getArticleDetails(this.alias_title).then((data: any) => { if (this.platform.is('android') || this.platform.is('capacitor')) { this.newsDetails = JSON.parse(data.data)['content'].data; @@ -64,7 +62,7 @@ export class HomeDetailsPage implements OnInit { } if (type === 'videos') { - this.newsService.getVideoDetails(alias_title).then((data: any) => { + this.newsService.getVideoDetails(this.alias_title).then((data: any) => { if (this.platform.is('android') || this.platform.is('capacitor')) { @@ -80,7 +78,7 @@ export class HomeDetailsPage implements OnInit { } if (type === 'gallery') { - this.newsService.getGalleryDetails(alias_title).then((data: any) => { + this.newsService.getGalleryDetails(this.alias_title).then((data: any) => { if (this.platform.is('android') || this.platform.is('capacitor')) { @@ -95,6 +93,22 @@ export class HomeDetailsPage implements OnInit { }); } } + + ngAfterViewInit(){ + (function(d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + js = d.createElement(s); js.id = id; + js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4"; + + if (d.getElementById(id)){ + //if