+
diff --git a/public/docs/_examples/cb-a11y/ts/app/shared/a11y-custom-control.component.ts b/public/docs/_examples/cb-a11y/ts/app/shared/a11y-custom-control.component.ts
new file mode 100644
index 0000000000..a62782d9ba
--- /dev/null
+++ b/public/docs/_examples/cb-a11y/ts/app/shared/a11y-custom-control.component.ts
@@ -0,0 +1,68 @@
+import {Component, OnInit, Provider, forwardRef,} from "angular2/core";
+import {A11yHelper} from "../services/a11y-helper.service";
+import {NG_VALUE_ACCESSOR, ControlValueAccessor} from "angular2/common";
+
+// #docregion
+const noop = () => {
+};
+
+const A11Y_CUSTOM_CONTROL_VALUE_ACCESSOR = new Provider(
+ NG_VALUE_ACCESSOR, {
+ useExisting: forwardRef(() => A11yCustomControl),
+ multi: true
+ });
+
+@Component({
+ selector: 'a11y-custom-control',
+ templateUrl: './app/shared/a11y-custom-control.component.html',
+ styleUrls: ['./app/shared/a11y-custom-control.component.css'],
+ providers: [A11Y_CUSTOM_CONTROL_VALUE_ACCESSOR]
+})
+export class A11yCustomControl implements OnInit, ControlValueAccessor {
+
+ uniqueId:string;
+
+ private _innerValue:any = '';
+ outerValue:string = '';
+
+ private _onTouchedCallback:() => void = noop;
+ private _onChangeCallback:(_:any) => void = noop;
+
+ constructor(private _a11yHelper:A11yHelper) {
+ }
+
+ onChange(event:any, value:string) {
+ if (event.keyCode == 13) {
+ event.preventDefault();
+ }
+ else {
+ this._innerValue = this._a11yHelper.removeHtmlStringBreaks(value);
+ this._onChangeCallback(this._innerValue);
+ }
+ }
+
+ onBlur(){
+ this._onTouchedCallback();
+ }
+
+ writeValue(value:any) {
+ if (value != this._innerValue) {
+ this._innerValue = value;
+ this.outerValue = value;
+ }
+ }
+
+ registerOnChange(fn:any) {
+ this._onChangeCallback = fn;
+ }
+
+ registerOnTouched(fn:any) {
+ this._onTouchedCallback = fn;
+ }
+
+ ngOnInit():void {
+ this.uniqueId = this._a11yHelper.generateUniqueIdString();
+ }
+
+}
+// #enddocregion
diff --git a/public/docs/_examples/cb-a11y/ts/app/shared/a11y-value-helper.component.html b/public/docs/_examples/cb-a11y/ts/app/shared/a11y-value-helper.component.html
new file mode 100644
index 0000000000..bde42e27d4
--- /dev/null
+++ b/public/docs/_examples/cb-a11y/ts/app/shared/a11y-value-helper.component.html
@@ -0,0 +1,5 @@
+
+ Current value: {{displayValue}}
+
diff --git a/public/docs/_examples/cb-a11y/ts/app/shared/a11y-value-helper.component.ts b/public/docs/_examples/cb-a11y/ts/app/shared/a11y-value-helper.component.ts
new file mode 100644
index 0000000000..6443299ec6
--- /dev/null
+++ b/public/docs/_examples/cb-a11y/ts/app/shared/a11y-value-helper.component.ts
@@ -0,0 +1,18 @@
+import {Component, Input} from "angular2/core";
+
+@Component({
+ selector: 'a11y-value-helper',
+ templateUrl: './app/shared/a11y-value-helper.component.html',
+ styles: [`
+ .value-label {
+ position:relative;
+ top: -15px;
+ }
+`]
+})
+export class A11yValueHelper {
+
+ @Input()
+ displayValue: any;
+
+}
diff --git a/public/docs/_examples/cb-a11y/ts/example-config.json b/public/docs/_examples/cb-a11y/ts/example-config.json
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/public/docs/_examples/cb-a11y/ts/example-config.json
@@ -0,0 +1 @@
+
diff --git a/public/docs/_examples/cb-a11y/ts/index.html b/public/docs/_examples/cb-a11y/ts/index.html
new file mode 100644
index 0000000000..e56cff83f3
--- /dev/null
+++ b/public/docs/_examples/cb-a11y/ts/index.html
@@ -0,0 +1,42 @@
+
+
+
+
+ A11y demonstration
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+loading...
+
+
+
diff --git a/public/docs/_examples/cb-a11y/ts/plnkr.json b/public/docs/_examples/cb-a11y/ts/plnkr.json
new file mode 100644
index 0000000000..8e4e448188
--- /dev/null
+++ b/public/docs/_examples/cb-a11y/ts/plnkr.json
@@ -0,0 +1,8 @@
+{
+ "description": "A11y Cookbook samples",
+ "files":[
+ "!**/*.d.ts",
+ "!**/*.js"
+ ],
+ "tags":["cookbook", "a11y"]
+}
\ No newline at end of file
diff --git a/public/docs/dart/latest/cookbook/_data.json b/public/docs/dart/latest/cookbook/_data.json
index 2c28e02169..bd5fd9d990 100644
--- a/public/docs/dart/latest/cookbook/_data.json
+++ b/public/docs/dart/latest/cookbook/_data.json
@@ -12,6 +12,11 @@
"hide": true
},
+ "a11y": {
+ "title": "Accessibility and ARIA Reference",
+ "navTitle": "Accessibility and ARIA",
+ "intro": "Learn how to make your Angular 2 sites accessible for everyone"
+ },
"component-communication": {
"title": "Component Interaction",
"intro": "Share information between different directives and components"
diff --git a/public/docs/dart/latest/cookbook/a11y.jade b/public/docs/dart/latest/cookbook/a11y.jade
new file mode 100644
index 0000000000..e44128c6a2
--- /dev/null
+++ b/public/docs/dart/latest/cookbook/a11y.jade
@@ -0,0 +1,2 @@
+!= partial("../../../_includes/_ts-temp")
+
diff --git a/public/docs/js/latest/cookbook/_data.json b/public/docs/js/latest/cookbook/_data.json
index f4f89de38c..6ce6585204 100644
--- a/public/docs/js/latest/cookbook/_data.json
+++ b/public/docs/js/latest/cookbook/_data.json
@@ -11,6 +11,12 @@
"intro": "Learn how Angular 1 concepts and techniques map to Angular 2"
},
+ "a11y": {
+ "title": "Accessibility and ARIA reference",
+ "navTitle": "Accessibility and ARIA",
+ "intro": "Learn how to make your Angular 2 sites accessible for everyone"
+ },
+
"component-communication": {
"title": "Component Interaction",
"intro": "Share information between different directives and components"
@@ -21,7 +27,7 @@
"intro": "Techniques for Dependency Injection"
},
- "dynamic-form": {
+ "dynamic-forms": {
"title": "Dynamic Form",
"intro": "Render dynamic forms with NgFormModel"
},
diff --git a/public/docs/js/latest/cookbook/a11y.jade b/public/docs/js/latest/cookbook/a11y.jade
new file mode 100644
index 0000000000..6778b6af28
--- /dev/null
+++ b/public/docs/js/latest/cookbook/a11y.jade
@@ -0,0 +1 @@
+!= partial("../../../_includes/_ts-temp")
diff --git a/public/docs/ts/latest/cookbook/_data.json b/public/docs/ts/latest/cookbook/_data.json
index 211e12bfd4..41b69fc89c 100644
--- a/public/docs/ts/latest/cookbook/_data.json
+++ b/public/docs/ts/latest/cookbook/_data.json
@@ -11,6 +11,12 @@
"intro": "Learn how Angular 1 concepts and techniques map to Angular 2"
},
+ "a11y": {
+ "title": "Accessibility and ARIA Reference",
+ "navTitle": "Accessibility and ARIA",
+ "intro": "Learn how to make your Angular 2 sites accessible for everyone"
+ },
+
"component-communication": {
"title": "Component Interaction",
"intro": "Share information between different directives and components"
diff --git a/public/docs/ts/latest/cookbook/a11y.jade b/public/docs/ts/latest/cookbook/a11y.jade
new file mode 100644
index 0000000000..00d4a690b5
--- /dev/null
+++ b/public/docs/ts/latest/cookbook/a11y.jade
@@ -0,0 +1,801 @@
+include ../_util-fns
+
+:marked
+ Many people rely on assistive technologies to interact with the web, accessing visual
+ content via screen readers or braille displays. Some rely exclusively on the keyboard for
+ input, others adapt to motor impairment via pointing devices other than a mouse.
+
+ This guide will show you how to design Angular components and applications that work well
+ for all users.
+
+:marked
+ **Follow along in this [live example](/resources/live-examples/cb-a11y/ts/plnkr.html)**.
+
+
+.l-main-section
+
+:marked
+ ## Table of contents
+
+ [Accessible form control labels](#form-control-labels)
+
+ [Managing focus](#managing-focus)
+
+ [Roles for custom component widgets](#component-roles)
+
+
+.l-main-section
+
+:marked
+ ## Accessible form control labels
+
+ Native HTML elements already have accessibility support via the browser. Because Angular extends
+ HTML and allows you to create your own elements, it's important to ensure that anything you add
+ also works in an accessible way.
+
+.l-sub-section
+ :marked
+ If there is already an HTML element that provides the function that you need, use that element
+ instead of writing your own. You'll get all the built-in browser support for focus management,
+ tabindex, etc. and have more time to think about your code. If you want to accept user text
+ input, use the `input` element instead of constructing something new.
+
+:marked
+ Because assistive technologies can't rely on the visual appearance of a form component,
+ any form component, or `form control` must be explicitly labeled to ensure that it's clear what
+ its purpose is.
+
+ We will discuss some ways to do this.
+
+ ### Implicit labeling
+
+ The most direct way to assign an accessible label to a form control is by `implicit
+ labeling` with a `