Contents
- Particular button
- Whole ButtonGroup
Having trouble getting help?
Contact Support
Contact Support
Disable in Angular Button group component
27 Apr 20242 minutes to read
Particular button
To disable a particular button in a ButtonGroup, disabled
attribute should be added to corresponding button element.
Whole ButtonGroup
To disable whole ButtonGroup, disabled
attribute should be added to all the button elements.
The following example illustrates how to disable the particular and the whole ButtonGroup.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { enableRipple } from '@syncfusion/ej2-base'
import { Component } from '@angular/core';
@Component({
imports: [
ButtonModule
],
standalone: true,
selector: 'app-root',
template: `<div class="e-section-control">
<!-- To render ButtonGroup. -->
<div class='e-btn-group'>
<button ejs-button>HTML</button>
<button ejs-button [disabled]="true">CSS</button>
<button ejs-button>Javascript</button>
</div>
<div class='e-btn-group'>
<button ejs-button [disabled]="true">HTML</button>
<button ejs-button [disabled]="true">CSS</button>
<button ejs-button [disabled]="true">Javascript</button>
</div>
</div>`
})
export class AppComponent { }
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));
To disable radio/checkbox type ButtonGroup, the
disabled
attribute should be added to the particular input element.