Skip to content

Instantly share code, notes, and snippets.

View webwizart's full-sized avatar

w3bwizart webwizart

View GitHub Profile
Verifying my Blockstack ID is secured with the address 1ACsaktBFZuf3NywjVkFhc5d91n32Eo3CR https://explorer.blockstack.org/address/1ACsaktBFZuf3NywjVkFhc5d91n32Eo3CR
@webwizart
webwizart / question.component.html
Created January 6, 2017 11:42
Angular 2 - Dynamic Reactive form with Radio Inputs build with FormBuilder, FormGroup - !!! Working !!!
<form [formGroup]="reactiveForm" novalidate>
<h2> Question {{question.Question.Order}} </h2>
<h3> {{question.Question.QuestionText}}</h3>
<p class="description"> {{question.Question.Description}} </p>
<span *ngIf="question.Question.Type === 'SingleChoice'">
<span *ngFor="let answer of question.Question.PossibleAnswers; let i = index">
<br>
<input #radio type="radio" [value]="answer.Id" formControlName="answer" [checked]="answer.IsAnswered" (click)="storeRadioSelection(answer.Id)" /> {{answer.Value}}
<textarea *ngIf="answer.RequireJustification && radio.checked"
name="justification" rows="3" cols="100" required placeholder="Please add your justification here" (blur)="storeJustification()"> {{answer.Justification}}
@webwizart
webwizart / question.component.html
Last active September 20, 2017 08:10
Angular 2 - Dynamic Reactive form with Radio Inputs build with FormBuilder, FormGroup, FormArray - !!! Not working !!!
<span formArrayName="answers">
<span *ngFor="let answer of reactiveForm.controls.answers.controls; let i = index">
<br>
<input #radio type="radio" formControlName="{{i}}"
[checked]="answer.value?.answer?.IsAnswered"
[value]="answer.value?.answer?.Value" />
{{answer.value?.answer?.Value}} ->
{{radio.checked}}<br />