init commit
This commit is contained in:
commit
5b7c7d4d19
25 changed files with 8503 additions and 0 deletions
38
src/app/radio.component.ts
Normal file
38
src/app/radio.component.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-radio',
|
||||
template: `
|
||||
<div class="radio">
|
||||
|
||||
<div *ngFor="let choice of field.options.choices">
|
||||
|
||||
<input type="radio" name="field.id" class="choice"
|
||||
[value]="choice"
|
||||
[(ngModel)]="field.value"
|
||||
(ngModelChange)="check()"
|
||||
/>
|
||||
|
||||
<label>{{ choice }}</label>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class RadioComponent implements OnInit {
|
||||
|
||||
@Input() field: Field;
|
||||
@Output() update: EventEmitter<null> = new EventEmitter();
|
||||
|
||||
ngOnInit() { console.log("Text", this.field.id); }
|
||||
|
||||
check() {
|
||||
|
||||
this.field.ok = true;
|
||||
|
||||
this.update.emit();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue