angular简单路由

引入并配置路由

src\app\app.module.ts

 

使用路由

在src\app\app.component.html,添加

<router-outlet>类似一个页面的占位符。

首先展示首页ProductList。当点击【添加】后,里面的内容就变为添加页面ProductAdd。

发表评论