The Button directive provides the Ignite UI Button functionality to every component that's intended to be used as a button.
- Igx Module
- IgxButtonModule
- Igx Theme
- igx-button-theme
- Igx Keywords
- button, span, div, click
Remarks
Example
<button type="button" igxButton="outlined">A Button</button> Constructors
Section titled "Constructors"IgxButtonDirective
new IgxButtonDirective(): IgxButtonDirective Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:124
Returns IgxButtonDirective
Properties
Section titled "Properties"buttonClick
Section titled "buttonClick"Inherited from: IgxButtonBaseDirective
Emitted when the button is clicked.
buttonClick: EventEmitter<any> Defined in projects/igniteui-angular/directives/src/directives/button/button-base.ts:35
buttonSelected
Section titled "buttonSelected"Called when the button is selected.
buttonSelected: EventEmitter<IButtonEventArgs> Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:57
disabled
Section titled "disabled"Inherited from: IgxButtonBaseDirective
Enables/disables the button.
disabled: boolean = false Defined in projects/igniteui-angular/directives/src/directives/button/button-base.ts:91
Example
<button igxButton="fab" disabled></button> element
Section titled "element"Inherited from: IgxButtonBaseDirective
element: ElementRef<any> Defined in projects/igniteui-angular/directives/src/directives/button/button-base.ts:27
Inherited from: IgxButtonBaseDirective
Sets/gets the role attribute.
role: string = 'button' Defined in projects/igniteui-angular/directives/src/directives/button/button-base.ts:47
Example
this.button.role = 'navbutton';
let buttonRole = this.button.role; Accessors
Section titled "Accessors"label
Section titled "label"get label(): any Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:153
Sets the aria-label attribute.
set label(value: string): void Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:153
Example
<button type="button" igxButton="flat" igxLabel="Label"></button> Parameters
- value:
string
Returns void
nativeElement
Section titled "nativeElement"Inherited from: IgxButtonBaseDirective
Returns the underlying DOM element.
get nativeElement(): any Defined in projects/igniteui-angular/directives/src/directives/button/button-base.ts:143
Returns any
selected
Section titled "selected"get selected(): boolean Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:120
Returns boolean
Gets or sets whether the button is selected. Mainly used in the button group component and it will have no effect if set separately.
set selected(value: boolean): void Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:113
Example
<button type="button" igxButton="flat" [selected]="button.selected"></button> Parameters
- value:
boolean
Returns void
get type(): any Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:137
Sets the type of the button.
set type(type: IgxButtonType): void Defined in projects/igniteui-angular/directives/src/directives/button/button.directive.ts:137
Example
<button type="button" igxButton="outlined"></button> Parameters
- type:
IgxButtonType
Returns void
Methods
Section titled "Methods"ngAfterViewInit
Section titled "ngAfterViewInit"Inherited from: IgxButtonBaseDirective
A callback method that is invoked immediately after Angular has completed initialization of a component's view. It is invoked only once when the view is instantiated.
ngAfterViewInit(): void Defined in projects/igniteui-angular/directives/src/directives/button/button-base.ts:112
Returns void
ngOnDestroy
Section titled "ngOnDestroy"Inherited from: IgxButtonBaseDirective
A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.
ngOnDestroy(): void Defined in projects/igniteui-angular/directives/src/directives/button/button-base.ts:123