2014-07-22 3 views
0

초보자를 구현에 실패합니다. 경우 폴리머를 tutorial을하려고 - 간단한 요소를 구현합니다.폴리머 - 간단한 요소 웹 DEV에서

index.html을

<!doctype html> 
<html> 

<head> 
    <title>My Test</title> 

    <script src="./components/platform/platform.js"></script> 

    <link rel="import" href="my-element.html"> 

    <style> 
     div { width: 300px;} 
     my-element { font: bold 16px cursive;} 
    </style> 
</head> 

<body> 
    <div> 
    <my-element></my-element> 
    </div> 
</body>  
</html> 

내-element.html

<polymer-element name="my-element"> 
    <template> 
     <div> 
      <p>rtrthdfghdfghdfghdgsdfasdfa</p> 
     </div> 
    </template> 
</polymer-element> 

화면에 아무 것도 나타나지 않습니다. 은 크롬 SDL과 검사의 모든 자원을 확인 (200)로드됩니다. 내가 잘못 뭘하는지

<!doctype html> 
<html> 

    <head> 
     <title>My Test</title> 
     <!-- <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> --> 
     <script src="./components/platform/platform.js"></script> 

     <link rel="import" href="my-element.html"> 

     <style> 
      div { width: 300px;} 
      my-element { font: bold 16px cursive;} 
     </style> 
    </head> 

    <body> 
     <div> 
     <my-element></my-element> 
     </div> 
    </body> 

    </html> 

:

이 렌더링 후 페이지 소스는?

답변

2

당신은 두 가지를 변경해야합니다 : 그것은 더 자바 스크립트를 포함하지 Polymer('my-element',{});

  • 수입의 주요 폴리머 HTML 파일로 구성 요소를 등록하지 않기 때문에,

    • 이 요소에 noscript 속성을 추가 당신 my-element.html : <link rel="import" href="./components/polymer/polymer.html">
  • +0

    감사합니다. – user1025852

    관련 문제