forked from tykayn/funky-framadate-front
start combine choices array
This commit is contained in:
parent
b0026fabc4
commit
4bec5828b3
@ -33,7 +33,26 @@
|
|||||||
<i class="fa fa-close"></i>
|
<i class="fa fa-close"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<label for="descr">Description</label>
|
<br />
|
||||||
|
<h2>Choix de réponse</h2>
|
||||||
|
<div formArrayName="choicesFormArray">
|
||||||
|
<h3>Aliases</h3>
|
||||||
|
<button (click)="addChoice()">Add Alias</button>
|
||||||
|
|
||||||
|
<div *ngFor="let choice of choices.controls; let i = index">
|
||||||
|
<!-- The repeated alias template -->
|
||||||
|
<pre class="debug padded warning">
|
||||||
|
choice :
|
||||||
|
{{ choice | json }}
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<label>
|
||||||
|
choices:
|
||||||
|
<input type="text" [formControlName]="i" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<label for="descr">Description (optionnel)</label>
|
||||||
<textarea
|
<textarea
|
||||||
#description
|
#description
|
||||||
matInput
|
matInput
|
||||||
@ -86,6 +105,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="complete" *ngIf="longFormVersionEnabled">
|
<div class="complete" *ngIf="longFormVersionEnabled">
|
||||||
<form [formGroup]="configurationFormGroup">
|
<form [formGroup]="configurationFormGroup">
|
||||||
|
<h2>
|
||||||
|
Type de sondage
|
||||||
|
</h2>
|
||||||
|
<button class="btn" [ngClass]="{ 'is-primary': isAboutDate.value }" (click)="isAboutDate = true">
|
||||||
|
Spécial date
|
||||||
|
</button>
|
||||||
|
<button [ngClass]="{ 'is-primary': !isAboutDate.value }" (click)="isAboutDate = false">
|
||||||
|
Classique - textes
|
||||||
|
</button>
|
||||||
|
|
||||||
<h2>Version complète du formulaire</h2>
|
<h2>Version complète du formulaire</h2>
|
||||||
<mat-form-field appearance="outline" class="is-flex">
|
<mat-form-field appearance="outline" class="is-flex">
|
||||||
<mat-label>Nombre de jours avant expiration</mat-label>
|
<mat-label>Nombre de jours avant expiration</mat-label>
|
||||||
|
@ -80,4 +80,11 @@ export class FormComponent implements OnInit {
|
|||||||
let newValueFormatted = 'TODO';
|
let newValueFormatted = 'TODO';
|
||||||
this.pollFormGroup.patchValue({ slug: newValueFormatted });
|
this.pollFormGroup.patchValue({ slug: newValueFormatted });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get choices() {
|
||||||
|
return this.choicesFormArray.get('aliases') as FormArray;
|
||||||
|
}
|
||||||
|
addChoice() {
|
||||||
|
this.choices.push(this.fb.control(''));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user