From a4c96299b158f346ece1e015b9563c615835c504 Mon Sep 17 00:00:00 2001 From: sabash Date: Tue, 23 Jul 2019 18:02:32 +0530 Subject: [PATCH] removed home from path --- src/app/app-routing.module.ts | 2 +- .../components/plotly/plotly.component.ts | 21 +++++++++++++------ src/app/view/view-routing.module.ts | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d67ac7b..7beb942 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router'; import { NotFoundComponent } from './view/home/not-found/not-found.component'; export const routes: Routes = [ - { path: '', redirectTo: 'home', pathMatch: 'full' }, + // { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: '', loadChildren: './view/view.module#ViewModule', diff --git a/src/app/shared/components/plotly/plotly.component.ts b/src/app/shared/components/plotly/plotly.component.ts index 7c925b2..08f70ed 100644 --- a/src/app/shared/components/plotly/plotly.component.ts +++ b/src/app/shared/components/plotly/plotly.component.ts @@ -51,12 +51,21 @@ import { return this._options; } showChart(){ - this._plotlyJs.newPlot( - this.plotly.nativeElement, - this._data, - this._layout, - this._options, - ); + try { + if (typeof this._plotlyJs.newPlot === "function") { + this._plotlyJs.newPlot( + this.plotly.nativeElement, + this._data, + this._layout, + this._options, + ); + } + + } + catch (error) { + console.error('Log error', error); + } + } ngAfterViewInit() { if(this._plotlyJs){ diff --git a/src/app/view/view-routing.module.ts b/src/app/view/view-routing.module.ts index 11d60a0..1347203 100755 --- a/src/app/view/view-routing.module.ts +++ b/src/app/view/view-routing.module.ts @@ -5,7 +5,7 @@ import { SiteLayoutComponent } from '../shared/components/layouts/site-layout/si const viewRoutes: Routes = [ { - path: 'home', + path: '', loadChildren: './home/home.module#HomeModule', }, ];