Skip to content

Instantly share code, notes, and snippets.

@chrisksamueljr
Created May 22, 2019 00:44
Show Gist options
  • Save chrisksamueljr/610a467b7d8550907b0fb07eda1236c9 to your computer and use it in GitHub Desktop.
Save chrisksamueljr/610a467b7d8550907b0fb07eda1236c9 to your computer and use it in GitHub Desktop.
gender radio component button
interface Option {
label: string;
value: any;
}
interface Message {
[key: string]: Function | string;
}
@Component({
selector: 'gender-radio-group',
template: `
<gender-radio-group
[name]="name"
[label]="label"
[radioOptions]="radioOptions"
[control]="control"
[messages]="messages">
</gender-radio-group>
`,
})
export class GenderRadioComponent {
@Input() name = 'gender';
@Input() label = 'Gender*';
@Input() control: FormControl;
@Input() messages: Message;
@Input()
radioOptions: Option[] = [
{
label: 'Male',
value: 'm',
},
{
label: 'Female',
value: 'f',
},
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment