2015-06-07 27 views
2

我在我的角度应用程序中复制并粘贴了https://www.polymer-project.org/1.0/docs/devguide/templates.html的代码。模板标签内的任何内容都不是呈现。角度应用程序中的聚合物模板的数据绑定问题

<dom-module id="employee-list"> 
    <template> 

    <div> Employee list: </div> 
    <template is="dom-repeat" items="{{employees}}"> 
     <div>First name: <span>{{item.first}}</span></div> 
     <div>Last name: <span>{{item.last}}</span></div> 
    </template> 

    </template> 

    <script> 
    Polymer({ 
     is: 'employee-list', 
     ready: function() { 
     this.employees = [ 
      {first: 'Bob', last: 'Smith'}, 
      {first: 'Sally', last: 'Johnson'} 
     ]; 
     } 
    }); 
    </script> 

</dom-module> 
+0

当你声明这个元素时,你是否包含Polymer?你是否在index.html或其他元素中正确导入了这个元素?你能发布更多的代码吗? –

回答

0

这只是一个错字。我拼错了模板名称。