数据绑定问题与角度app内的聚合物模板

时间:2015-06-07 18:51:47

标签: angularjs polymer

我在我的角应用中复制并粘贴了来自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>

1 个答案:

答案 0 :(得分:0)

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