Skip to content

Commit

Permalink
feat(buttons): add aria-attributes (#4082)
Browse files Browse the repository at this point in the history
Closes #4068
  • Loading branch information
tarusin authored and valorkin committed Apr 25, 2018
1 parent 6e2e60f commit 49ee88e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import { Component } from '@angular/core';
templateUrl: './custom-checkbox-value.html'
})
export class DemoButtonsCustomCheckboxValueComponent {
singleModel: string = '1';
singleModel = '1';
}
4 changes: 2 additions & 2 deletions demo/src/ng-api-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ export const ngdoc: any = {
{
"name": "btnCheckboxFalse",
"defaultValue": "false",
"type": "any",
"type": "boolean",
"description": "<p>Falsy value, will be set to ngModel </p>\n"
},
{
"name": "btnCheckboxTrue",
"defaultValue": "true",
"type": "any",
"type": "boolean",
"description": "<p>Truthy value, will be set to ngModel </p>\n"
}
],
Expand Down
4 changes: 3 additions & 1 deletion src/buttons/button-checkbox.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export class ButtonCheckboxDirective implements ControlValueAccessor, OnInit {
/** Falsy value, will be set to ngModel */
@Input() btnCheckboxFalse: any = false;

@HostBinding('class.active') state = false;
@HostBinding('class.active')
@HostBinding('attr.aria-pressed')
state = false;

protected value: any;
protected isDisabled: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/buttons/button-radio.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class ButtonRadioDirective implements ControlValueAccessor, OnInit {
}

@HostBinding('class.active')
@HostBinding('attr.aria-pressed')
get isActive(): boolean {
return this.btnRadio === this.value;
}
Expand Down

0 comments on commit 49ee88e

Please sign in to comment.