Created
May 22, 2019 00:44
-
-
Save chrisksamueljr/610a467b7d8550907b0fb07eda1236c9 to your computer and use it in GitHub Desktop.
gender radio component button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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