Articles in this section
Category / Section

How to get started easily with Syncfusion Angular 11 Radio Button?

2 mins read

A quick start project that helps you to create an Angular 11 Radio Button with a minimal code configurations.

The following section explains you how to create a simple angular 11 Radio Button component.

 

Prerequisites

 

Before start, we need following items to create Angular Radio Button in Angular 11 application.

 

Dependencies

 

  1. Install Angular CLI 11 using following command.

 

  1. npm install -g @angular/cli@11.2.3

 

Note:

If you would like to follow and run the application in Angular 6 or Angular 5 or Angular 4, you need to replace the CLI command version number with the corresponding angular version number.

 

npm install -g @angular/cli@<CLI VERSION>

 

 

  1. Create a new Angular 11 project using Angular CLI and navigate to the folder.

 

  1. ng new angular11-app
  2. cd angular11-app

 

Adding Radio Button

 

  1. After running the Angular 11 application successfully, configure the Angular Radio Button in this application. Install Angular Radio Button and EJ2 package using following command.

 

  1. npm install @syncfusion/ej2-angular-buttons –save

 

The --save command will instruct the NPM to include a Radio Button package inside the dependencies section of the package.json.

 

  1. Import RadioButtonModule from installed package.
  2. Import and inject the other required modules within the providers section of app.module.ts.

 

import { BrowserModule } from '@angular/platform-browser';

import { NgModule } from '@angular/core';

import { RadioButtonModule } from '@syncfusion/ej2-angular-buttons';

import { AppComponent } from './app.component';

import { enableRipple } from '@syncfusion/ej2-base'

 

enableRipple(true);

 

@NgModule({

    declarations: [

        AppComponent

    ],

    imports: [

        BrowserModule,

        RadioButtonModule

    ],

    providers: [],

    bootstrap: [AppComponent]

})

export class AppModule { }

 

  1. Add the given below angular Radio Button’s styles in styles.css.

 

@import "../node_modules/@syncfusion/ej2-base/styles/material.css";

@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";

 

  1. Add the angular Radio Button component in app.component.ts.

 

 import { Component } from '@angular/core';

 

@Component({

    selector: 'app-root',

    template: `<ul>

    <li><ejs-radiobutton label="Credit/Debit Card" name="default"></ejs-radiobutton></li>

    <li><ejs-radiobutton label="Internet Banking" name="default"></ejs-radiobutton></li>

    <li><ejs-radiobutton label="Cash on Delivery" name="default"></ejs-radiobutton></li>

    <li><ejs-radiobutton label="Other Wallets" name="default"></ejs-radiobutton></li>

    </ul>`

})

export class AppComponent {}

 

  1. Now serve the application following command.

 

  1. ng serve

 

Once the files are compiled successfully, it will serve the site at localhost:4200

 

Screenshot:

Radio_button

Summary

 

Refer to our documentation and online samples for more features. If you have any queries, please let us know in comments below.  You can also contact us through our Support forum or Direct-Trac. We are happy to assist you!

Conclusion
I hope you enjoyed learning about how to get started easily with Syncfusion Angular 11 Radio Button.

You can refer to our Angular Radio feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Angular Radio examples to understand how to create and manipulate data.

For current customers, you can check out our Document Processing Libraries from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied