11 angularjs中的路由--routing生成路由配置路由路由重定向1 07 angularjs中的路由.pdf

想预览更多内容,点击预览全文

申明敬告:

本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己完全接受本站规则且自行承担所有风险,本站不退款、不进行额外附加服务;如果您已付费下载过本站文档,您可以点击这里二次下载

文档介绍

Angular4.x中的路由主讲教师:(大地)合作网站:(IT营)合作网站:(Ionic中文网)目录一、Angular命令创建一个配置好路由的项目1二、Angula4.x在已有的项目中配置路由3三、AngularrouterLink页面跳转默认跳转路由5四、AngularrouterLinkActive设置routerLink默认选中路由6五、路由的动态传值6六、路由的js跳转7七、路由的js跳转get传值8八、父子路由9一、Angular命令创建一个配置好路由的项目1.命令创建项目ngnewdemo02–-routing2.创建需要的组件nggcomponenthomenggcomponentnewsnggcomponentnewscontent3.找到app-routing.module.ts配置路由引入组件import{HomeComponent}from'./home/ponent';import{NewsComponent}from'./news/ponent';import{NewscontentComponent}from'./newscontent/ponent';配置路由constroutes:Routes=[{path:'home',component:HomeComponent},{path:'news',component:NewsComponent},{path:'newscontent/:id',component:NewscontentComponent},{path:'',redirectTo:'/home',pathMatch:'full'}];4.找到ponen

最近下载