一级导航
详细步骤
1、创建angular项目
ng new angualrdemo08 --skip-install
进入项目cd angular08
,并下载各种包 。使用npm i
或cnpm i
命令
2、创建需要的组件
ng g component home
ng g component new
ng g component header
ng g component home/asideone
ng g component home/asidetwo
ng g componenthome/asidethree
等等
3、找到 app-routing.module.ts 配置路由
用命令创建的组件,会自动引入app.module.ts
文件里,把这些路径复制粘贴到app-routing.module.ts
文件里ÿ