angular.js - Can views of the same level be loaded separately in angular ui router?
伊谢尔伦
伊谢尔伦 2017-05-15 16:49:39
0
1
601

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

angular ui router can define multiple views, like this

<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>

I still haven’t found a way to load the viewA and viewB views separately

In other words, when a state changes, only a few of the views at the same level are rendered, and some are not rendered

I just started learning, could you please give me some advice on whether it is possible to render views separately

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学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