AngularUI路由器 - 什么是执行&QUOT的最佳途径;同时进行多个国家和QUOT ;? [英] AngularUI Router - What's the best way to implement "multiple simultaneous states"?

查看:124
本文介绍了AngularUI路由器 - 什么是执行&QUOT的最佳途径;同时进行多个国家和QUOT ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我得到了同样的页面,可以被看作是小部件上的两个或两个以上的观点 - 他的状态转变在很大程度上是自包含的 - 什么是实现这种多个同时国家的最佳方式。

Say I've got two or more views on the same page that could be seen as widgets - whose state transitions are largely self-contained - what's the best way to implement this kind of "multiple simultaneous states"?

(或请纠正我,如果这不是多个同时国家的意思)

(Or please correct me if this is not what "multiple simultaneous states" means)

推荐答案

究竟你要实现的目标还不是很清楚,但是这可能帮助。
多命名景观

what exactly you are trying to achieve is not very clear but this might help. Multiple-Named-Views

您也可以管理像状态:

$stateProvider.state("a", {
        url: "/a",    
        title: "PartA",
        templateUrl: "partA.html",
        controller: "aCtrl"
      }).state("a.list", {
        url: "/list/:id",    
        title: "PartA-List",
        views: {
          "list": {
            templateUrl: "partA.list.html"
          }
        }      
      }).state("a.list.detail", {
        url: "/detail/:rowId",
        title: "PartA-Detail",
        views: {
          "detail": {
            templateUrl: "partA.detail.html"
          }
        }
     });

a.html

a.html

<div ui-view="list"></div>

partA.list.html

partA.list.html

<div ui-view="detail"></div>

这篇关于AngularUI路由器 - 什么是执行&QUOT的最佳途径;同时进行多个国家和QUOT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆