angular/angular.js — pull request #10318 by marcysutton (2014-12-04 00:41:00+00:00)
Title: Roles dynamically added with ngAria

To communicate the purpose of custom inputs with a type of `range`, `checkbox` or `radio`, ngAria now dynamically adds roles to custom radio buttons, checkboxes and sliders. Related issue: https://github.com/angular/angular.js/issues/10012

It also adds a role of `button` to any element with `ngClick` that is not a `button` or `anchor` element (such as a `div`). This feature comes on the heels of https://github.com/angular/angular.js/pull/10288, which binds the `keypress` event alongside `ngClick`. With these two changes together, users of assistive technologies will know what they are focused on (this is important because `ngAria` dynamically adds `tabIndex="0"` with `ngClick`). HOWEVER, not all uses of ngClick are used for buttons–sometimes developers bind `ng-click` on the document. In this scenario, a role can be overridden by the developer if `button` does not match expected behavior. Related issue: https://github.com/angular/angular.js/issues/9254

Note: This change does not implement any kind of flag allowing the user to opt out of roles being set.