Repeat pattern in repeat pattern

Is it possible to repeat patterns inside a pattern? I would like to have something like this:

  
<polymer-element name="polymer-mylement">
<template>
   <div class="col-xs-12 col-sm-12 col-md-12">
      {{ myobject.stringone }}
      <br>
      {{ myobject.stringtwo }}
      <br>
      <table>
        <tbody>
          <tr template repeat="{{ a in myobject.as}}" >
            <td>{{ a.type }}</td>

            <tr template repeat="{{ b in a.bs }}">
              <li>
                {{ b.type }}
              </li>
            </tr>
          </tr>
        </tbody>
    </table>
   </div>
</template>
<script type="application/dart" src="polymer_myelement.dart"></script>
</polymer-element>

polymer_mylement.dart

import 'dart:html';
import 'dart:core';
import 'package:polymer/polymer.dart';
import 'dart:typed_data';
import 'protobuf/***/myobject.pb.dart';  
import 'package:custom_element/custom_element.dart';
import 'package:intl/intl.dart';

class MyObject { 
   String string1;
   String string2;
   List<a> as;

   MyObject(this.string1, this.string2, this.as);
}

class a {
   String type;
   List<b> bs;

   a(this.type, this.bs);
}

class b {
   String type;

   b(this.type);
}

@CustomTag('polymer-myelement')
class MyObjectElement extends PolymerElement with ObservableMixin {

    bool get applyAuthorStyles => true;

    @observable MyObject myobject;
}

main() {

  void onDataLoaded(ByteBuffer response) {

    Uint8List li = new Uint8List.view(response);
    MyObject myobject = new MyObject.fromBuffer(li);

    List<a> as = new List();
    List<b> bs = new List();

    for(final a in myobject.as) {
       for (final b in a.bs){
          bs.add(new b(b.type));
       } 
       as.add(new a(a.type.toString(), bs));
    }

    MyObject myobject = new MyObject(myobject.string1, myobject.string2, as);


 var myElem = createElement('polymer-myelement');
 MyObjectElement moele = myElem.xtag;
 moele.myobject = myobject;
 query('.container').children.add(myElem);



}

query('#menu-mylement').onClick.listen((MouseEvent event){

   query('.container').children.clear();

   try { 
     var url = "*****";
     var request = new HttpRequest();
     request.open('GET', url);
     request.responseType = "arraybuffer";
     request.onLoad.listen((event) => onDataLoaded(event.target.response) 
       //print('Request complete ${event.target.response}')
     );
     request.send();
     }
     catch (e) {
        print(e);
     }

 });
}

As you can see, I have a MyObject that contains a list. There is another list in the list of items "a". In generell, in my main () method, I retrieve some protobuf data from our WebService. In my onDataLoaded, I translated the binary string back into readable format. Now I create my MyObject and populate its ListElements through some loops through my answer.

In my template, I would like to make a result.

It works until the second pattern is repeated. I see row 1 and row2 from MyObject, as well as a view from the list. But does he not show me the second rep for my list?

Is it possible, or am I doing something mandatory?

+4
1

. , , tr tr. JavaScript , , , td.

+1

All Articles