如何首先http请求数据然后调用Polymer()?

时间:2017-08-03 20:34:25

标签: polymer

我经常在数据组件中注意到这种模式(在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?

0 个答案:

没有答案