angular-ui-router API UI Router 中有三种方式激活一个路由: (1)$state.go():优先级较高的便利方式 (2)ui-sref:点击包含此指令跳转 ( <a ui-sref="home">Home | <a ui-sref="about">About (1)ui-sref-active=”active” 该路由激活,则对应增加active 样式名称
ui-sref 一种将链接(标签)绑定到一个状态的指令。点击该链接将触发一个可以带有可选参数的状态转换。 代码: <a ui-sref="app.index">首页 <! -- 这里是正常的跳转 --> <a ui-sref="app.index({id:yourId})">你的主页 <! ="app">app
photo-detail.html 需要把查询字符串参数传递出去
ui-sref 一种将链接(标签)绑定到一个状态的指令。点击该链接将触发一个可以带有可选参数的状态转换。 代码: <a ui-sref="app.index">首页 <! -- 这里是正常的跳转 --> <a ui-sref="app.index({id:yourId})">你的主页 <! ="app">app
ui-sref='stateName' ui-sref='stateName({param:value, param:value})' ui-view ==没有名称的ui-view
以上通过ui-sref属性完成state之间的跳转。 ="content.photos">Photosuserinfo.html
|---- article.html
|-------- edit.html
HTML页面中的处理也是比较简单
index.html
------
'></script> 15 16 </head> 17 <body> 18
entry.isGateway"> <a ui-sref="dashboard.flowV1({app: entry.app})"> <a ui-sref="dashboard.flow({app: entry.app})"> <i class="
:找到 resources/app/scripts/directives/sidebar/sidebar.html中的这段代码:
页面后还有子页面,即在home页面某处点击进入子页面,以list为例:在home模板的页面上也有些固定的内容,也有可插入模板
的div,home模板的链接要写成 <a ui-sref.}); }); 触发状态迁移 在ui-router中定义的指令ui-sref用来触发状态迁移: <a ui-sref="state1">Go State 1 当用户点击这个链接时,$state
entry.isGateway"> <a ui-sref="dashboard.flow({app: entry.app})"> <i class="glyphicon glyphicon-filter
--<a ui-sref="dashboard.flow({app: entry.app})">--> <!
路由的核心是给应用定义"状态" • 使用路由机制会影响到应用的整体编码方式(需预先定义好状态) • 考虑兼容性问题与"优雅降级" 2.7.2.2 Angular-UI-Router使用技巧 ui-sref 指令链接到特定状态 <a ui-sref="home">Home <a ui-sref="about">About <a ui-sref="contacts.list">Contacts
entry.isGateway"> <a ui-sref="dashboard.flow({app: entry.app})"> <i class="glyphicon glyphicon-filter