Skip to content

Commit b49c370

Browse files
authored
Merge pull request #6738 from IgniteUI/pbozhinov/button-docs-annotations-9.0.x
docs(igxButton): updates API Docs for the igxButton directive - 9.0.x
2 parents ee791c2 + 618175b commit b49c370

File tree

1 file changed

+61
-24
lines changed

1 file changed

+61
-24
lines changed

projects/igniteui-angular/src/lib/directives/button/button.directive.ts

Lines changed: 61 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,69 @@ import {
1313
} from '@angular/core';
1414
import { DisplayDensityBase, DisplayDensityToken, IDisplayDensityOptions, DisplayDensity } from '../../core/density';
1515

16+
/**
17+
* The Button directive provides the Ignite UI Button functionality to every component that's intended to be used as a button.
18+
*
19+
* @igxModule IgxButtonModule
20+
*
21+
* @igxParent Data Entry & Display
22+
*
23+
* @igxTheme igx-button-theme
24+
*
25+
* @igxKeywords button, span, div, click
26+
*
27+
* @remarks
28+
* The Ignite UI Button directive is intended to be used by any button, span or div and turn it into a fully functional button.
29+
*
30+
* @example
31+
* ```html
32+
* <button igxButton="outlined">A Button</button>
33+
* ```
34+
*/
1635
@Directive({
1736
selector: '[igxButton]'
1837
})
1938
export class IgxButtonDirective extends DisplayDensityBase {
2039

2140
/**
22-
*@hidden
41+
* @hidden
42+
* @internal
2343
*/
2444
private _type: string;
2545

2646
/**
27-
*@hidden
47+
* @hidden
48+
* @internal
2849
*/
2950
private _defaultType = 'flat';
3051

3152
/**
32-
*@hidden
53+
* @hidden
54+
* @internal
3355
*/
3456
private _cssClassPrefix = 'igx-button';
3557

3658
/**
37-
*@hidden
59+
* @hidden
60+
* @internal
3861
*/
3962
private _color: string;
4063

4164
/**
42-
*@hidden
65+
* @hidden
66+
* @internal
4367
*/
4468
private _label: string;
4569

4670
/**
47-
*@hidden
71+
* @hidden
72+
* @internal
4873
*/
4974
private _backgroundColor: string;
5075

5176
/**
52-
*@hidden
77+
* @hidden
78+
* @internal
5379
*/
5480
private _disabled: boolean;
5581

@@ -59,37 +85,37 @@ export class IgxButtonDirective extends DisplayDensityBase {
5985
}
6086

6187
/**
62-
* Returns the underlying DOM element
88+
* Returns the underlying DOM element.
6389
*/
6490
public get nativeElement() {
6591
return this.element.nativeElement;
6692
}
6793

6894
/**
69-
* Called when the button is clicked
95+
* Called when the button is clicked.
7096
*/
7197
@Output()
7298
public buttonClick = new EventEmitter<any>();
7399

74100
/**
75101
* Sets/gets the `role` attribute.
102+
*
103+
* @example
76104
* ```typescript
77105
* this.button.role = 'navbutton';
106+
* let buttonRole = this.button.role;
78107
* ```
79-
* ```typescript
80-
* let buttonRole = this.button.role;
81-
* ```
82-
* @memberof IgxButtonDirective
83108
*/
84109
@HostBinding('attr.role')
85110
public role = 'button';
86111

87112
/**
88113
* Sets the type of the button.
114+
*
115+
* @example
89116
* ```html
90-
* <button igxButton= "icon"></button>
117+
* <button igxButton="icon"></button>
91118
* ```
92-
* @memberof IgxButtonDirective
93119
*/
94120
@Input('igxButton')
95121
set type(value: string) {
@@ -103,10 +129,11 @@ export class IgxButtonDirective extends DisplayDensityBase {
103129

104130
/**
105131
* Sets the button text color.
132+
*
133+
* @example
106134
* ```html
107135
* <button igxButton="gradient" igxButtonColor="blue"></button>
108136
* ```
109-
* @memberof IgxButtonDirective
110137
*/
111138
@Input('igxButtonColor') set color(value: string) {
112139
this._color = value || this.nativeElement.style.color;
@@ -115,10 +142,11 @@ export class IgxButtonDirective extends DisplayDensityBase {
115142

116143
/**
117144
* Sets the background color of the button.
118-
* ```html
145+
*
146+
* @example
147+
* ```html
119148
* <button igxButton="raised" igxButtonBackground="red"></button>
120149
* ```
121-
* @memberof IgxButtonDirective
122150
*/
123151
@Input('igxButtonBackground') set background(value: string) {
124152
this._backgroundColor = value || this._backgroundColor;
@@ -127,10 +155,11 @@ export class IgxButtonDirective extends DisplayDensityBase {
127155

128156
/**
129157
* Sets the `aria-label` attribute.
130-
* ```html
158+
*
159+
* @example
160+
* ```html
131161
* <button igxButton= "flat" igxLabel="Label"></button>
132162
* ```
133-
* @memberof IgxButtonDirective
134163
*/
135164
@Input('igxLabel') set label(value: string) {
136165
this._label = value || this._label;
@@ -139,10 +168,11 @@ export class IgxButtonDirective extends DisplayDensityBase {
139168

140169
/**
141170
* Enables/disables the button.
142-
* ```html
171+
*
172+
* @example
173+
* ```html
143174
* <button igxButton= "fab" [disabled]="true"></button>
144175
* ```
145-
* @memberof IgxButtonDirective
146176
*/
147177
@Input() set disabled(val) {
148178
val = !!val;
@@ -156,6 +186,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
156186

157187
/**
158188
* @hidden
189+
* @internal
159190
*/
160191
@HostBinding('class.igx-button--cosy')
161192
public get cssClassCosy(): boolean {
@@ -165,6 +196,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
165196

166197
/**
167198
* @hidden
199+
* @internal
168200
*/
169201
@HostBinding('class.igx-button--compact')
170202
public get cssClassCompact(): boolean {
@@ -174,6 +206,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
174206

175207
/**
176208
* @hidden
209+
* @internal
177210
*/
178211
@HostBinding('class.igx-button--fab-cosy')
179212
public get cssClassCosyFab(): boolean {
@@ -182,6 +215,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
182215

183216
/**
184217
* @hidden
218+
* @internal
185219
*/
186220
@HostBinding('class.igx-button--fab-compact')
187221
public get cssClassCompactFab(): boolean {
@@ -190,6 +224,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
190224

191225
/**
192226
* @hidden
227+
* @internal
193228
*/
194229
@HostBinding('attr.disabled')
195230
public get disabledAttribute() {
@@ -199,15 +234,17 @@ export class IgxButtonDirective extends DisplayDensityBase {
199234
/**
200235
* Gets or sets whether the button is selected.
201236
* Mainly used in the IgxButtonGroup component and it will have no effect if set separately.
237+
*
238+
* @example
202239
* ```html
203240
* <button igxButton="flat" [selected]="button.selected"></button>
204241
* ```
205-
* @memberof IgxButtonDirective
206242
*/
207243
@Input() public selected = false;
208244

209245
/**
210-
*@hidden
246+
* @hidden
247+
* @internal
211248
*/
212249
@HostListener('click', ['$event'])
213250
public onClick(ev) {

0 commit comments

Comments
 (0)