2014-10-31 34 views
2

此HTML工作:聚合物不能在IE 11使用聚合物的作品在Chrome,IE 11和Firefox模板重复生成一个HTML表格

<polymer-element name="greeting-tag"> 
    <template> 
     <template repeat="{{s in salutations}}"> 
     {{s.what}},{{s.who}} 
     </template>    
    </template> 
    <script> 
    Polymer('greeting-tag', { 
     ready: function() { 
     this.salutations = [ 
      {what: 'Hello', who: 'World'}, 
      {what: 'GoodBye', who: 'DOM APIs'}, 
      {what: 'Hello', who: 'Declarative'}, 
      {what: 'GoodBye', who: 'Imperative'} 
     ]; 
     } 
    }); 
    </script> 
</polymer-element> 

但是当模板重复替换代码渲染HTML表:

<polymer-element name="greeting-tag"> 
    <template> 
    <table> 
     <template repeat="{{s in salutations}}"> 
     <tr> 
      <td>{{s.what}}</td> 
      <td>{{s.who}}</td> 
     </tr> 
     </template>    
    </table> 
    </template> 
    <script> 
    Polymer('greeting-tag', { 
     ready: function() { 
     this.salutations = [ 
      {what: 'Hello', who: 'World'}, 
      {what: 'GoodBye', who: 'DOM APIs'}, 
      {what: 'Hello', who: 'Declarative'}, 
      {what: 'GoodBye', who: 'Imperative'} 
     ]; 
     } 
    }); 
    </script> 
</polymer-element> 

它在Chrome和Firefox,但它不能在IE 11工作(该元素是不是在所有渲染)。任何线索?

回答

4

好吧,这个问题已经被描述here,这个工程:

<polymer-element name="greeting-tag"> 
    <template>   
    <table> 
    <tr template repeat="{{s in salutations}}"> 
     <td>{{s.what}}</td> 
     <td>{{s.who}}</td> 
    </tr> 
    </table>  
    </template> 
    <script> 
    Polymer('greeting-tag', { 
     ready: function() { 
     this.salutations = [ 
      {what: 'Hello', who: 'World'}, 
      {what: 'GoodBye', who: 'DOM APIs'}, 
      {what: 'Hello', who: 'Declarative'}, 
      {what: 'GoodBye', who: 'Imperative'} 
     ]; 
     } 
    }); 
    </script> 
</polymer-element>