Skip to content

Commit

Permalink
Merge pull request #24 from hadesdday/vanhieu
Browse files Browse the repository at this point in the history
#5 - fix post list routing param
  • Loading branch information
hadesdday authored Aug 9, 2022
2 parents 2496b53 + 7a4b9c6 commit b2d2d9f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/pages/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>
<div class="row">
<div class="d-flex justify-content-center">
<a href="chinh-tri">
<a [href]="get_slug(posts_list?.[0]?.categories?.[0]||'')">
<p class="fs-11 text-muted">{{posts_list[0]?.categories}}</p>
</a>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/app/pages/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ export class HomeComponent implements OnInit {
this.tech_list = res.items;
this.tech_list.forEach(elm => {
var title = elm['title'];
var first = title.replace("&amp;amp;apos;", "'");
var second = first.replace("&amp;amp;apos;", "'");
var second = title.split("&amp;amp;apos;").join("'");
elm['title'] = second;
});
console.log("tech", res);
Expand Down
3 changes: 1 addition & 2 deletions src/app/post/post-list/post-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ export class PostListComponent implements OnInit {
this.posts_list = res.items;
this.posts_list.forEach(elm => {
var title = elm['title'];
var first = title.replace("&amp;amp;apos;", "'");
var second = first.replace("&amp;amp;apos;", "'");
var second =title.split("&amp;amp;apos;").join("'");
elm['title'] = second;
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/post/post-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SearchResultComponent } from './search-result/search-result.component';

const routes: Routes = [
{ path: 'search/:keyword/:tag', component: SearchResultComponent },
{ path: ':title', component: PostListComponent }
{ path: 'chu-de/:title', component: PostListComponent }
];

@NgModule({
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<a class="nav-link text-dark" aria-current="page" href="vietnamnet">Tin nóng</a>
</li>
<li class="nav-item news-topic fw-bold" *ngFor="let item of feeds_list">
<a class="nav-link text-dark" aria-current="page" href="{{item?.slug}}">{{item.title}}</a>
<a class="nav-link text-dark" aria-current="page" href="chu-de/{{item?.slug}}">{{item.title}}</a>
</li>
</ul>
</div>
Expand Down

0 comments on commit b2d2d9f

Please sign in to comment.