如何使用angular2 json架构表单创建一段字段?

我正在使用 https://github.com/dschnelldavis/angular2-json-schema-form,我的表单HTML是:
<json-schema-form
[schema]="schema"
(onSubmit)="exampleOnSubmitFn($event)">
</json-schema-form>

我的架构是:

this.schema = {
  type: "object",properties: {
    CCN: {
      required: true,type: "number",minimum: 1000000000,maximum: 99999999999999999999
    },Quarter: {
      type: 'string',required: true,enum: ['Q1','Q2','Q3','Q4']
    },Year: {
      type: 'string',enum: ['2018','2019','2020']  
    },covered_medi: {
      title: "Covered by Medicare/Medicaid",required: true
    },covered_private: {
      title: "Covered by private insurance",Uninsured: {
      type: "number",}
}

我希望Quarter和Year在一个单独的部分.我尝试使用layout属性

this.layout = [{
  type: "fieldset",title: "Reporting Period",items: [{
    key: "Quarter"
  },{
    key: "Year"
  }]
}]

但这似乎行不通.

如果您有 installed and instantiated the provider.唯一可能失败的是schema,examples或回调,使用空的测试.

TS

@Component({...})
export class MyComponent {

   public schema: any = {...}
   public onSubmit(event) {...}
   ... }

HTML

<json-schema-form
  [schema]="schema"
  (onSubmit)="onSubmit($event)">
</json-schema-form>

在这example中,把所需的每个属性.

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...