如何在Angular 8中路由到新页面?

时间:2020-04-02 08:06:45

标签: angular angular8 angular-routing

我在主页上有三个链接:-

ComponentA ComponentB ComponentC

现在,如果我单击ComponentA,则输出为

**** ComponentA ComponentB ComponentC ComponentA有效。****

我希望看到输出,即单击组件A之后,将仅显示组件A

ComponentA有效

我是Angular 8的新手,只知道基础知识。请帮忙

1 个答案:

答案 0 :(得分:0)

在您的app.cpmponent.html中添加<router-outlet></router-outlet>并删除其他组件