Skip to content
Snippets Groups Projects
Commit 3f60ffe1 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Fix bug radio => DONE

parent a38f207d
No related branches found
No related tags found
2 merge requests!68Develop,!28Bug attribute options
......@@ -2,9 +2,9 @@
<label class="col-3 col-form-label">{{label}}</label>
<div class="col">
<div *ngFor="let option of options" class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="cb_{{option.id}}" [formControl]="radio"
[value]="option.id">
<label class="form-check-label" for="cb_{{option.id}}">{{option.label}}</label>
<input class="form-check-input" type="radio" id="cb_{{option.value}}" [formControl]="radio"
[value]="option.value">
<label class="form-check-label" for="cb_{{option.value}}">{{option.label}}</label>
</div>
</div>
<div class="col-2 align-self-center text-center">
......
......@@ -22,7 +22,7 @@ export class RadioComponent {
radio = new FormControl('');
addCriterion() {
const option = this.options.find(o => o.id === this.radio.value);
const option = this.options.find(o => o.value === this.radio.value);
const cb = new RadioCriterion(this.id, option);
this.add.emit(cb);
}
......@@ -33,7 +33,7 @@ export class RadioComponent {
this.radio.enable();
} else {
const c = criterion as RadioCriterion;
this.radio.setValue(c.option.id);
this.radio.setValue(c.option.value);
this.radio.disable();
}
}
......
......@@ -14,6 +14,6 @@ export class RadioCriterion extends Criterion {
}
getCriterionStr(): string {
return this.id + '-rd-' + this.option.value;
return this.id + ':eq:' + this.option.value;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment