This commit is contained in:
Olu Amey
2020-09-13 16:47:45 -04:00
parent 0c367f4d7c
commit 364a6a231f
3 changed files with 19 additions and 5 deletions
+8
View File
@@ -22,6 +22,14 @@ const routes: Routes = [
{
path: 'blog',
loadChildren: () => import('./blog/blog.module').then( m => m.BlogPageModule)
},
{
path: 'blogdetail',
loadChildren: () => import('./blogdetail/blogdetail.module').then( m => m.BlogdetailPageModule)
},
{
path: 'login',
loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
}
];
+1 -1
View File
@@ -7,7 +7,7 @@
</ion-card-header>
</ion-card>
<ion-card *ngFor="let type of blog_list">
<ion-card *ngFor="let type of blog_list" (click)="openBlogItem(type)">
<ion-card-header>
<!-- ion-card-subtitle>{{type.post_title}}</!-->
+10 -4
View File
@@ -1,6 +1,8 @@
import { BlackConnectService } from './../api/black-connect.service';
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Router } from '@angular/router';
@Component({
selector: 'app-blog',
@@ -10,12 +12,12 @@ import { Observable } from 'rxjs';
export class BlogPage implements OnInit {
CurrentDate = new Date().getDate();
blogData: any;
constructor(private blackConnectService: BlackConnectService) {
this. getBlog();
constructor(private blackConnectService: BlackConnectService,private router: Router) {
this.getBlog();
}
image_url = "https://blog.chiefsoft.com/wp-content/uploads/";
ngOnInit() {
this. getBlog();
this.getBlog();
}
blog_list: any;
@@ -24,12 +26,16 @@ export class BlogPage implements OnInit {
this.blogData = retBlogData;
//console.log(this.blogData);
//console.log(this.blogData["internal_return"]["result_list"]);
this.image_url= this.blogData["internal_return"]["image_url"];
this.image_url = this.blogData["internal_return"]["image_url"];
this.blog_list = this.blogData["internal_return"]["result_list"];
console.log(this.blog_list);
})
}
openBlogItem(selBlogdata: any) {
// alert(selBlogdata.id);
this.router.navigateByUrl("blogdetail",selBlogdata);
}
}