Angular2:动态填充组件表单

时间:2017-01-27 15:50:34

标签: angular angular-components

我有一个带有此模板的角度组件(mainComponent)

<form (ngSubmit)="onSubmit()" #scheduleForm="ngForm" *ngIf="schedule">
    My Main Component 

   <!-- secondaryComponents goes here -->
   <button type="submit" class="btn btn-default[disabled]="!scheduleForm.form.valid">Submit</button>.
</form>

和另一个组件(secondaryComponent)。

mainComponent,在init上调用一个返回数字的web服务,我需要向mainComponent添加与返回的webservice值一样多的secondaryComponent。 我该怎么办?

0 个答案:

没有答案
相关问题