fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
@@ -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}}</!-->
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user