Skip to content

Commit

Permalink
feat(d-ng-rating): HostBinding updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Darko Andreev committed Apr 16, 2020
1 parent 1ec0e30 commit d8c0df8
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions projects/d-ng-rating/src/lib/ng-rating.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ export class NgRatingComponent implements OnChanges, ControlValueAccessor {
return 0;
}

@HostBinding('attr.aria-valuemax') get ariaValueMax(): number {
return this.size;
}

@HostBinding('attr.aria-valuenow') get ariaValueNow(): number {
return this._selectedIndex + 1;
}
Expand All @@ -121,18 +117,6 @@ export class NgRatingComponent implements OnChanges, ControlValueAccessor {
return this.disabled ? -1 : 0;
}

@HostBinding('attr.aria-disabled') get ariaDisabled(): boolean {
return this.disabled;
}

@HostBinding('attr.aria-readonly') get ariaReadonly(): boolean {
return this.readonly;
}

@HostBinding('attr.aria-setsize') get ariaSetSize(): number {
return this.size;
}

/**
* Gets/sets the `rating` for the component.
* Determines selected rate items.
Expand Down Expand Up @@ -164,6 +148,8 @@ export class NgRatingComponent implements OnChanges, ControlValueAccessor {
* @memberOf NgRatingComponent
*/
@Input()
@HostBinding('attr.aria-valuemax')
@HostBinding('attr.aria-setsize')
public get size(): number {
return this._size;
}
Expand Down Expand Up @@ -193,6 +179,7 @@ export class NgRatingComponent implements OnChanges, ControlValueAccessor {
* @memberOf NgRatingComponent
*/
@Input()
@HostBinding('attr.aria-readonly')
public get readonly(): boolean {
return this._readonly;
}
Expand All @@ -212,6 +199,7 @@ export class NgRatingComponent implements OnChanges, ControlValueAccessor {
* @memberOf NgRatingComponent
*/
@Input()
@HostBinding('attr.aria-disabled')
public get disabled(): boolean {
return this._disabled;
}
Expand Down

0 comments on commit d8c0df8

Please sign in to comment.