Angular4.0_router:Angular4.0路由

时间:2021-04-29 08:10:34
【文件属性】:
文件名称:Angular4.0_router:Angular4.0路由
文件大小:135KB
文件格式:ZIP
更新时间:2021-04-29 08:10:34
TypeScript Angular Route 导航 路由基础 创建一个新的项目Demo,介绍路由知识 ng new router --routing 我们会发现多生成的一个文件app-routing.module.ts,这个文件就是当前应用的路由配置 生成一个home组件 ng g component home ng g component product 修改home.component.html和product.component.html

这里是主页组件

app-routing.module.ts 设置路由,把对应组件的文件配置进去 import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import {HomeComponent} from
【文件预览】:
Angular4.0_router-master
----router()
--------src()
--------angular.json(3KB)
--------tsconfig.json(384B)
--------tslint.json(3KB)
--------README.md(1023B)
--------.editorconfig(245B)
--------.gitignore(503B)
--------package-lock.json(354KB)
--------e2e()
--------package.json(1KB)
----imge()
--------1.png(24KB)
----README.md(21KB)

网友评论