根据不同地址,加载不同组件,实现单页面应用。 Angular 命令创建一个配置好路由的项目 命令创建项目 ng new demo02 --routing 安装依赖 npm install 启动项目 ng serve --open