我经常在数据组件中注意到这种模式(在Polymer商店和新闻演示应用程序中):
<script>
(function() {
var categoryList = [
{name: 'top_stories', title: 'Top Stories'},
{name: 'doodles', title: 'Doodles'},
{name: 'chrome', title: 'Chrome'},
{name: 'search', title: 'Search'},
{name: 'shopping_payments', title: 'Shopping & Payments'},
{name: 'nonprofits', title: 'Nonprofits'}
];
var textarea = document.createElement('textarea');
Polymer();
})();
</script>
是否可以首先发出http请求以从远程服务器获取categoryList
,然后调用Polymer?