Added Dropdown and Hidden Input
This commit is contained in:
@@ -6,11 +6,21 @@ import {FormGroup} from '@angular/forms';
|
||||
selector: 'dyn-question',
|
||||
template: `
|
||||
<div [ngSwitch]="question.type" [formGroup]="form">
|
||||
<label [for]="question.properties.key">{{question.properties.label}}</label>
|
||||
<tag-input *ngSwitchCase="'flag'"
|
||||
[formControlName]="question.properties.key" [id]="question.properties.key"
|
||||
[items]="question.properties.options" [nullable]="question.constraints.optional"
|
||||
(ngModelChange)="change()"></tag-input>
|
||||
<label [for]="question.properties.key">{{question.properties.label}}</label>
|
||||
<tag-input *ngSwitchCase="'flag'"
|
||||
[formControlName]="question.properties.key" [id]="question.properties.key"
|
||||
[nullable]="question.constraints.optional" [readonly]="type=='view'"
|
||||
[items]="question.properties.options"
|
||||
(ngModelChange)="change()"></tag-input>
|
||||
<hidden-input *ngSwitchCase="'hidden'"
|
||||
[formControlName]="question.properties.key" [id]="question.properties.key"
|
||||
[nullable]="question.constraints.optional" [readonly]="type=='view'"
|
||||
(ngModelChange)="change()"></hidden-input>
|
||||
<dropdown-input *ngSwitchCase="'dropdown'"
|
||||
[formControlName]="question.properties.key" [id]="question.properties.key"
|
||||
[nullable]="question.constraints.optional" [readonly]="type=='view'"
|
||||
[items]="question.properties.options"
|
||||
(ngModelChange)="change()"></dropdown-input>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user