MOBILE-3320 survey: Fix ngModel requires name error in console
parent
b974b6bf43
commit
e5b63b9dc2
|
@ -78,38 +78,41 @@
|
|||
</ng-container>
|
||||
|
||||
<!-- Subquestion -->
|
||||
<ion-radio-group [(ngModel)]="answers[question.name]" [required]="question.required" [name]="question.name">
|
||||
<ion-row *ngIf="question.parent !== 0" class="ion-align-items-center ion-padding-horizontal" [class.even]="isEven">
|
||||
<ng-container *ngIf="question.parent !== 0">
|
||||
<ion-radio-group [(ngModel)]="answers[question.name]" [required]="question.required" [name]="question.name">
|
||||
<ion-row *ngIf="question.parent !== 0" class="ion-align-items-center ion-padding-horizontal"
|
||||
[class.even]="isEven">
|
||||
|
||||
<ion-col size="7">
|
||||
<ion-label id="addon-mod_survey-{{question.id}}">
|
||||
<span [core-mark-required]="question.required">
|
||||
<strong>{{question.num}}.</strong> {{ question.text }}
|
||||
</span>
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col size="7">
|
||||
<ion-label id="addon-mod_survey-{{question.id}}">
|
||||
<span [core-mark-required]="question.required">
|
||||
<strong>{{question.num}}.</strong> {{ question.text }}
|
||||
</span>
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
|
||||
<!-- Tablet view: radio buttons -->
|
||||
<ion-col class="ion-hide-md-down ion-text-center" size="1"
|
||||
*ngFor="let option of question.optionsArray; let value=index;"
|
||||
>
|
||||
<!-- Empty slot to avoid errors on migration tslint checks -->
|
||||
<ion-radio [value]="value + 1" [attr.aria-label]="question.num + '. '+question.text + ': ' + option">
|
||||
</ion-radio>
|
||||
</ion-col>
|
||||
<ion-col class="ion-hide-md-up" size="5">
|
||||
<ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required"
|
||||
[attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet"
|
||||
[name]="question.name">
|
||||
<ion-select-option value="-1" selected disabled>{{ 'core.choose' | translate }}</ion-select-option>
|
||||
<ion-select-option *ngFor="let option of question.optionsArray; let value=index;"
|
||||
[value]="value +1">
|
||||
{{option}}
|
||||
</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-radio-group>
|
||||
<!-- Tablet view: radio buttons -->
|
||||
<ion-col class="ion-hide-md-down ion-text-center" size="1"
|
||||
*ngFor="let option of question.optionsArray; let value=index;"
|
||||
>
|
||||
<!-- Empty slot to avoid errors on migration tslint checks -->
|
||||
<ion-radio [value]="value + 1" [attr.aria-label]="question.num + '. '+question.text + ': ' + option">
|
||||
</ion-radio>
|
||||
</ion-col>
|
||||
<ion-col class="ion-hide-md-up" size="5">
|
||||
<ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required"
|
||||
[attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet"
|
||||
[name]="question.name">
|
||||
<ion-select-option value="-1" selected disabled>{{ 'core.choose' | translate }}</ion-select-option>
|
||||
<ion-select-option *ngFor="let option of question.optionsArray; let value=index;"
|
||||
[value]="value +1">
|
||||
{{option}}
|
||||
</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-radio-group>
|
||||
</ng-container>
|
||||
|
||||
<!-- Single question (don't belong to a category) -->
|
||||
<ng-container *ngIf="(!question.multiArray || question.multiArray.length == 0) && question.parent === 0">
|
||||
|
|
Loading…
Reference in New Issue