UI的路由器额外动态标签路由器、标签、动态、UI

2023-09-13 03:36:20 作者:淫大代表

Christoper,

Christoper,

我在想,如果有动态生成标签的使用情况下,想到的客户名单中,将与您在UI路由器额外的标签解决方案的工作?问题是,你的示例使用名为因为它们是在运行时生成并添加的路线是在配置时间,这不会在我的情况下工作的用户界面的视图。

I was wondering if the use case of having dynamically generated tabs, think of a list of clients, would work with your solution for tabs in ui-router extras? The issue is that your example uses named ui-views which would not work in my situation as they are generated at runtime and the routes that you added are at config time.

在此先感谢,Luisz

Thanks in advance, Luisz

推荐答案

您可以生成动态的只是用$ stateProvider在控制器的状态,并在视图绑定的名称与UI视图名称

You can generate states dynamically just using $stateProvider in your controller and the ui-view name in the view binding the name

<div ui-view="myView{{variable}}"></div>

有使用插值意见的问题,而是自0.2.12 (上传到最新的 0.2.13 的情况下,它不工作)和这里是一个例子,但没有UI的路由器临时演员。让我们知道,如果它工作正常或更新plnkr。

There was an issue using interpolated views, but is solved since 0.2.12 (Upload to latest 0.2.13 in case it doesn't work) and here is an example but without ui-router-extras. Let us know if it works fine or update a plnkr.