更多 - 为一个名称路由多个路径

时间:2015-07-20 19:01:19

标签: routing polymer polymer-1.0

我想将用户路由到home屏幕,如下例所示。

我的问题是,更多路由不允许单个name的多个路由路径。

如何在angularjs中创建其他类似的东西?

当所有无效路径进入name="home"

<more-route name="home" path="/home"></more-route>
<more-route name="home" path="/home/:mutation"></more-route>
<more-route name="home" path="/home/words/:mutation/:hu"></more-route>

1 个答案:

答案 0 :(得分:1)

我想你想要这个:

<more-route name="home" path="/home">
  <more-route name="mutation" path="/:mutation"></more-route>  
  <more-route name="words" path="/words/:mutation/:hu"></more-route>
</more-route>

<more-route-selector selectedParams="{{params}}">
  <iron-pages>
    <section route="home">
      <template if="{{ route('mutation').active }}">
        ...
      </template>
      <template if="{{ route('words').active }}">
        ...
      </template>
    </section>
  </iron-pages>
</more-route-selector>