Angular 11 get a checked checkbox values example. In this tutorial, you will learn how to get checked checkbox values in the angular 11 app.

In this tutorial will guide you step by step on how to get checked checkbox value with reactive form in angular 11 app.

And as well as, take website array variable with list of variable and display list of checkbox with website name. Then add on change event to get selected checkbox value with reactive form element in angular 11 app.

Angular 11 Checkbox Checked Event Example

  • Step 1 – Create New Angular App
  • Step 2 – Add Code on Module.ts File
  • Step 3 – Add Code on View File
  • Step 4 – Add Code On Component ts File
  • Step 5 – Start Angular App

Step 1 – Create New Angular App

First of all, open your terminal and execute the following command on it to install angular app:

ng new my-new-app

Step 2 – Add Code on Module.ts File

In this step, visit src/app directory and open app.module.ts file. Then add the following code into it:

1 import { BrowserModule } from '@angular/platform-browser';
2 import { NgModule } from '@angular/core';
3   
4 import { AppComponent } from './app.component';
5 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
6   
7 @NgModule({
8  declarations: [
9    AppComponent
10  ],
11  imports: [
12   BrowserModule,
13    FormsModule,
14    ReactiveFormsModule
15  ],
16 providers: [],
17  bootstrap: [AppComponent]
18 })
19 export class AppModule { }

#angular

Angular 11 Checkbox Checked Event Tutorial
14.20 GEEK