Angular this.router.navigate([';组件/NewComponent';]);它不起作用了

Angular this.router.navigate([';组件/NewComponent';]);它不起作用了,angular,angular8,Angular,Angular8,我已在项目仪表板中创建了新组件。项目路径如下所示 ~src\app\layout\dashboard\components\New Component 我在我的仪表板路由模块中添加了路由,如 import { NewComponentComponent } from './components/New Component/New-Component.component'; {path:'components/New Component',Component:NewComponentCompon

我已在项目仪表板中创建了新组件。项目路径如下所示 ~src\app\layout\dashboard\components\New Component

我在我的仪表板路由模块中添加了路由,如

import { NewComponentComponent } from './components/New Component/New-Component.component';
{path:'components/New Component',Component:NewComponentComponent}

我已从仪表板图表组件调用此页面

onChartClick(e) {         
        this.router.navigate(['components/New-Component']);
    }
当我点击图表时,它被导航到新组件页面,但它显示相同的仪表板页面。
.

在组件之前添加

this.router.navigate(['/components/New-Component']);

谢谢大家的帮助

为此,我使用了
this.router.navigate(['../components/newcomponent'])


它现在正在工作。

是否必须有这样的路径:“组件/新组件”?它不能是路径:“新组件”我也只尝试了新组件。它的行为相同。