angular.js - angular ui router 同一层次视图可以分别加载吗
伊谢尔伦
伊谢尔伦 2017-05-15 16:49:39
0
1
556

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

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

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

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

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

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

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
左手右手慢动作

What if you only specify the view (viewA/viewB) you want to change in a specific state?

The old official wiki has examples
https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views#example---name-matching

Added examples of using multiple views
http://plnkr.co/edit/wy4rqDSsQmHFLmC3Fhm4?p=preview

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!