2017-10-26 11 views
0

아주 간단한 라우팅을 시도하고 있지만 아직 작동하지 않습니다. 내 코드 :폴리머 앱 위치가 작동하지 않습니다.

<link rel="import" href="../../bower_components/polymer/polymer-element.html"> 

<dom-module id="lab1-app"> 
    <template> 
    <style> 
     :host { 
     display: block; 
     } 
    </style> 
    <app-location route="{{rt}}"></app-location> 
    <app-route 
     route="{{rt}}" 
     pattern="/:view" 
     data="{{rd}}" 
     tail="{{tail}}" 
    ></app-route> 
    <iron-pages selected="[[rd.view]]" attr-for-selected="pgid" fallback-selection="404" > 
     <h2 pgid="profile">Profile</h2> 
     <h2 pgid="detail">Detail</h2> 
     <h2 pgid="form">Form</h2> 
     <h2 pgid="404">404</h2> 
    </iron-pages> 
    </template> 

    <script> 
    /** 
    * @customElement 
    * @polymer 
    */ 
    class Lab1App extends Polymer.Element { 
     static get is() { return 'lab1-app'; } 
     static get properties() { 
     // console.log(dataRute); 
     return {}; 
     } 
    } 

    window.customElements.define(Lab1App.is, Lab1App); 
    </script> 
</dom-module> 

은 내가, 내가,

을 철 페이지는 항상 404을 보여 이후 작동하는지 알 수 잘못 어떤 부분이 확실하지 않다하지만 난 localhost:8081/detail를로드하려고 할 때, 그것은 여전히 ​​404을 보여 어떤 도움을 주셔서 감사합니다. 감사! 구현 문제

답변

0

아무것도, 난 내 index.html을

<link rel="import" href="../../bower_components/app-route/app-location.html"> 

네, 어리석은 실수에 <app-location>을 가져 잊지 않았다. 미안 디스크 공간을 차지하기위한 stackoverflow