Title issue fixed

This commit is contained in:
raja.blaze 2019-08-08 18:52:44 +05:30
parent bdf91e27ca
commit 6ec80ccd56
2 changed files with 14 additions and 3 deletions

View File

@ -2,6 +2,8 @@ import { Component, OnInit, Inject, AfterViewInit } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { Utils } from 'src/app/shared/utils';
import { Router } from '@angular/router';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'epic-explorer-home-worksapce',
@ -31,7 +33,7 @@ import { Router } from '@angular/router';
</div>
</div>
</div>
<div class="latest_blocks my-5">
<div class="container">
<div class="filter_shadow">
@ -46,7 +48,7 @@ export class HomeWorksapceComponent extends Utils
implements OnInit, AfterViewInit {
viewchartvar: boolean;
constructor(@Inject(DOCUMENT) public document: Document,
private router: Router) {
private router: Router,private route: ActivatedRoute,private titleService: Title) {
super(document);
if (this.router.url == '/all') {
this.viewchartvar = false;
@ -55,7 +57,10 @@ export class HomeWorksapceComponent extends Utils
}
}
ngOnInit() {}
ngOnInit() {
this.titleService.setTitle(
this.route.snapshot.data.title,
);}
viewchartenable() {
this.viewchartvar = false;

View File

@ -7,6 +7,9 @@ const viewRoutes: Routes = [
{
path: '',
loadChildren: './home/home.module#HomeModule',
data: {
title: 'Epic Explorer - Home',
},
},
{
path: 'all',
@ -21,6 +24,9 @@ const siteRoutes: Routes = [
{
path: 'blockdetail/:hash',
loadChildren: './block-view/block-view.module#BlockViewModule',
data: {
title: 'Epic Explorer - Block',
},
},
{
path: 'chart',