聚合物 dom-与 dom 结合-重复无效

polymer dom-bind with dom-repeat not working

以下 html 文件未按预期显示结果。

不知道是什么问题

<!DOCTYPE html>
<html>
<head>
    <title>auto-binding test</title>
    <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
    <link rel="import" href="bower_components/polymer/polymer.html"/>

</head>
<body unresolved>
<template id="greeter" is="dom-bind">
    <template is="dom-repeat" items="{{names}}">
        <p>Hello, {{item}}, how are you today?</p>
    </template>
</template>
<script>
    (function(){
        document.querySelector('#greeter').names = ["Alice", "Brenda"];
    })()
</script>

</body>
</html>

To bind to a child element’s textContent, you can simply include the annotation inside the child element. The binding annotation must currently span the entire content of the tag:

<template>   
  First: <span>{{firstName}}</span><br>
  Last: <span>{{lastName}}</span>
</template>

所以改为:

<p>Hello, <span>[[item]]</span>, how are you today?</p>