Skip to main content

Posts

Showing posts with the label Angular 5 Material Radio Button Form Controls

Angular 5 Material Radio Button Form Controls

A radio-button is an element that allows the user to choose only one option from a set. The below example is used to choose only one option from a gender set using Angular 5 Materia l . radiobutton.ts - import { Component } from '@angular/core' ; @ Component ({   selector : 'radiobutton' ,   templateUrl : 'radiobutton.html' }) export class Radiobutton { //Todo – Radio button } And radiobutton.html – < mat-card >   < mat-card-content >     < h2 > Pick Your Gender </ h2 >     < section >       < mat-radio-group [( ngModel )] = "Gender" >         < mat-radio-button value = "Male" > Male </ mat-radio-button >         < mat-radio-button value = "Female" > Female </ mat-radio-button >       </ mat-radio-group ...