1

我正在尝试从我的 json 文件构建一个动态表单(textarea 元素)

  {  
  "name": "description",  
  "title": "Description",  
  "type": { 
    "view": "textarea"
    }  
} 

我使用 ngSwitch 作为元素类型

<div *ngFor="#form of form_fields">
        {{form.type.view}}
 <span [ngSwitch]="form.type.view">  
   <span *ngSwitchWhen="textarea">    
        <md-input-container>         
      <textarea md-input [(ngModel)]="form.name" columns="1"></textarea>
        </md-input-container>
  </span>  
 </span>
 </div>

但我有一个错误

EXCEPTION: No <input> or <textarea> found inside of <md-input-container>

Plunker - Form 有什么问题?

在此处输入图像描述

PS<md-input-container>产生错误

4

0 回答 0