0

I have a list of differents components in controller and I need render them, How?

Dart:

@NgController(
selector: '[my-controller]',
publishAs: 'ctrl'

)
class MyController {

  List components;

  MyController() {
     components = new List();
     components.add(new ComponentType1());
     components.add(new ComponentType2());
  }
}

HTML:

<div my-controller>
  <div ng-repeat="component in ctrl.components">
     <!-- How render the component here? -->
  </div>
</div>
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
MiguelAngel_LV
  • 1,200
  • 5
  • 16
  • possible duplicate of [How to add a component programatically in Angular.Dart?](http://stackoverflow.com/questions/20423565/how-to-add-a-component-programatically-in-angular-dart) – Günter Zöchbauer Apr 09 '14 at 07:51
  • Could you expand on your use-case? Looking at your code here, the best way is simply to enumerate all the components in the HTML. – James deBoer Apr 10 '14 at 03:53
  • I have a few components that extends a parent components. User is a parent component and I have student and teacher components that extends of user. I add teachers and students to the list, and I need render this list. I implemented "toString" to create HTML tags but this create new components, not render the actuals. – MiguelAngel_LV Apr 10 '14 at 08:55

0 Answers0