首页 > angular ui router 同一层次视图可以分别加载吗

angular ui router 同一层次视图可以分别加载吗

https://github.com/angular-ui/ui-router

angular ui router 可以定义多个视图,像这样

<body>
    <div ui-view="viewA"></div>
    <div ui-view="viewB"></div>
    <!-- Also a way to navigate -->
    <a ui-sref="route1">Route 1</a>
    <a ui-sref="route2">Route 2</a>
</body>

始终没有找到这里的viewA和viewB 视图分别加载的办法

或者说在一次状态改变的时候,同层次下的视图,只渲染其中的几个,有几个不渲染

刚开始学习,大家指教一下,分别渲染视图可以做到吗


只在特定的狀態指定想要改變的視圖(viewA/viewB)的話?

官方舊的 wiki 有範例
https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views#example---name-matching

補上使用多視圖的範例
http://plnkr.co/edit/wy4rqDSsQmHFLmC3Fhm4?p=preview

【热门文章】
【热门文章】