2016-07-27 5 views
3

私は2時間以上基本的なルートを正しく取得しようとしています。私はPolymer 1.5.0を使用しており、ネストされたルートを使用する際に問題が発生しています。ポリマーネストされたアプリルートが正しくマッピングされていません

Iはthis post suggestsようAPP-経路0.9.2

を使用している、ポリマーは、ルーティングに分散型アプローチを使用します。そこで私は、次の操作を行うことを決めた。

<app-route route="{{route}}" 
     pattern="/:page" 
     data="{{data}}" 
     tail="{{tail}}"> 
</app-route> 

    <iron-pages selected="{{data.page}}" attr-for-selected="title" fallback-selection="404"> 
     <pgarena-home-app title="" route="{{tail}}" ></pgarena-home-app> 
     <pgarena-tournament-app title="tournament" route="{{tail}}"></pgarena-tournament-app> 
     <pgarena-account-app title="account" route="{{tail}}"></pgarena-account-app> 
     <div title="404"> 
      <h1>{{data.page}} could not be found!</h1> 
     </div> 
    </iron-pages> 

サブページ:

pgarena口座アプリ

<iron-pages selected="{{data.action}}" attr-for-selected="title" fallback-selection="404"> 
      <pgarena-account-index-view title=""></pgarena-account-index-view> 
      <pgarena-account-login-view title="login"></pgarena-account-login-view> 
      <pgarena-account-register-view title="register"></pgarena-account-register-view> 
      <div title="404"> 
       <h1>Not found :(</h1> 
      </div> 
     </iron-pages> 

pgarena-トーナメントアプリ

​​

すべてがOKと思われます、 右? URLによると私がここでやっていることは、要素のレイジーロードを利用しているのです。

私はPolycasts examplesで「隠された」アプローチを使用していることがわかりました。彼らは要素を選択します。問題は、「レイジーローディングアドバンテージ」を失うことです。

私はしばらく私の頭を叩いていた...何が間違っている可能性がありますか?

答えて

4

OMG!私は完全に忘れてしまった。 In Polycasts #46/47ロブ・ドッドソンは鉄セレクタを使用しているとき、私たちは一日の終わりだから、中括弧{}

対角括弧[]でそれである一方向結合を渡す必要があることを重点を作りますされている必要があります:

<iron-pages selected="[[data.action]]" 

の代わりに:

<iron-pages selected="{{data.action}}" 
関連する問題