diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index cd505a7..68df95a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -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) } ]; diff --git a/src/app/blog/blog.page.html b/src/app/blog/blog.page.html index 65d3cce..97a4fe2 100644 --- a/src/app/blog/blog.page.html +++ b/src/app/blog/blog.page.html @@ -7,7 +7,7 @@ - + diff --git a/src/app/blog/blog.page.ts b/src/app/blog/blog.page.ts index e5a3e97..246f71f 100644 --- a/src/app/blog/blog.page.ts +++ b/src/app/blog/blog.page.ts @@ -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); + } }