Skip to content

Commit f53c3e2

Browse files
authored
Merge pull request #1516 from IgniteUI/fix-issue-1502
Enhance the IgxAvatarComponent documentation
2 parents 7a3d5d8 + 94f7f66 commit f53c3e2

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

projects/igniteui-angular/src/lib/avatar/avatar.component.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
4040

4141

4242
/**
43-
* This is a reference to the avatar image element in the DOM.
43+
* This is a reference to the avatar `image` element in the DOM.
4444
*
4545
* ```typescript
4646
* let image = this.avatar.image;
@@ -68,7 +68,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
6868
@ViewChild('iconTemplate', { read: TemplateRef })
6969
protected iconTemplate: TemplateRef<any>;
7070
/**
71-
* Returns the aria-label of the avatar.
71+
* Returns the `aria-label` of the avatar.
7272
*
7373
* ```typescript
7474
* let ariaLabel = this.avatar.ariaLabel;
@@ -78,7 +78,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
7878
@HostBinding('attr.aria-label')
7979
public ariaLabel = 'avatar';
8080
/**
81-
* Returns the role attribute of the avatar.
81+
* Returns the `role` attribute of the avatar.
8282
*
8383
* ```typescript
8484
* let avatarRole = this.avatar.role;
@@ -101,7 +101,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
101101
public cssClass = 'igx-avatar';
102102
/**
103103
* Returns the type of the avatar.
104-
* The avatar can be: "initials type avatar", "icon type avatar" or "image type avatar".
104+
* The avatar can be: `"initials type avatar"`, `"icon type avatar"` or `"image type avatar"`.
105105
*
106106
* ```typescript
107107
* let avatarDescription = this.avatar.roleDescription;
@@ -117,7 +117,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
117117
private _size: string | Size = 'small';
118118

119119
/**
120-
* Sets the id of the avatar. If not set, the first avatar component will have id = "igx-avatar-0".
120+
* Sets the `id` of the avatar. If not set, the first avatar component will have `id` = `"igx-avatar-0"`.
121121
*
122122
* ```html
123123
* <igx-avatar id="my-first-avatar"></igx-avatar>
@@ -129,7 +129,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
129129
@Input()
130130
public id = `igx-avatar-${NEXT_ID++}`;
131131
/**
132-
* Sets a round shape to the avatar if "roundShape" is true.
132+
* Sets a round shape to the avatar if `roundShape` is `"true"`.
133133
* By default the shape of the avatar is a square.
134134
*
135135
* ```html
@@ -143,7 +143,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
143143
public roundShape = false;
144144

145145
/**
146-
* Sets the avatar's initials/icon color.
146+
* Sets the avatar's `initials`/`icon` color.
147147
*
148148
*```html
149149
*<igx-avatar color="blue"></igx-avatar>
@@ -167,7 +167,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
167167
public bgColor: string;
168168

169169
/**
170-
* Sets initials to the avatar.
170+
* Sets `initials` to the avatar.
171171
*
172172
* ```html
173173
* <igx-avatar initials="MN"></igx-avatar>
@@ -179,7 +179,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
179179
public initials: string;
180180

181181
/**
182-
* Sets an icon to the avatar. All icons from the material icon set are supported.
182+
* Sets an `icon` to the avatar. All icons from the material icon set are supported.
183183
*
184184
* ```html
185185
* <igx-avatar icon="phone"></igx-avatar>
@@ -191,7 +191,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
191191
public icon: string;
192192

193193
/**
194-
* Sets the image source of the avatar.
194+
* Sets the `image` source of the avatar.
195195
*
196196
* ```html
197197
* <igx-avatar src="images/picture.jpg"></igx-avatar>
@@ -203,7 +203,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
203203
public src: string;
204204

205205
/**
206-
* Returns the size of the avatar.
206+
* Returns the `size` of the avatar.
207207
*
208208
* ```typescript
209209
*let avatarSize = this.avatar.size;
@@ -217,8 +217,8 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
217217
}
218218

219219
/**
220-
* Sets the size of the avatar.
221-
* By default the size is "small". It can be set to "medium" or "large".
220+
* Sets the `size` of the avatar.
221+
* By default the `size` is `"small"`. It can be set to `"medium"` or `"large"`.
222222
*
223223
* ```
224224
* <igx-avatar size="large"></igx-avatar>
@@ -288,7 +288,7 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
288288
}
289289

290290
/**
291-
* Returns the url of the image.
291+
* Returns the url of the `image`.
292292
*
293293
* ```typescript
294294
* let imageSourceUrl = this.avatar.getSrcUrl();
@@ -300,7 +300,9 @@ export class IgxAvatarComponent implements OnInit, AfterViewInit {
300300
return `url(${this.src})`;
301301
}
302302
}
303-
303+
/**
304+
* The `IgxAvatarModule` provides the {@link IgxAvatarComponent} inside your application.
305+
*/
304306
@NgModule({
305307
declarations: [IgxAvatarComponent],
306308
exports: [IgxAvatarComponent],

0 commit comments

Comments
 (0)