angular 应用中聚合物模板的数据绑定问题
data binding issue with polymer template inside angular app
我从 https://www.polymer-project.org/1.0/docs/devguide/templates.html 复制并粘贴代码到我的 angular 应用程序中。模板标签内的任何内容都不会呈现。
<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>
这只是一个错字。我拼错了模板名称。
我从 https://www.polymer-project.org/1.0/docs/devguide/templates.html 复制并粘贴代码到我的 angular 应用程序中。模板标签内的任何内容都不会呈现。
<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>
这只是一个错字。我拼错了模板名称。