Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 491b8a7

Browse files
committed
docs(cb-a11y): Content - Form controls
1 parent 5233a0d commit 491b8a7

File tree

4 files changed

+55
-15
lines changed

4 files changed

+55
-15
lines changed

public/docs/_examples/cb-a11y/ts/app/app.component.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component} from 'angular2/core';
1+
import {Component} from "angular2/core";
22
import {ROUTER_DIRECTIVES, RouteConfig, ROUTER_PROVIDERS} from "angular2/router";
33
import {A11yFormControls} from "./form-controls/a11y-form-controls.component";
44
import {A11yIndex} from "./a11y-index.component";
@@ -7,8 +7,15 @@ import {A11yHelper} from "./services/a11y-helper.service";
77
@Component({
88
selector: 'app',
99
templateUrl: 'app/app.component.html',
10-
directives:[ROUTER_DIRECTIVES, A11yFormControls, A11yIndex],
11-
providers: [ROUTER_PROVIDERS, A11yHelper]
10+
directives:[
11+
ROUTER_DIRECTIVES,
12+
A11yFormControls,
13+
A11yIndex
14+
],
15+
providers: [
16+
ROUTER_PROVIDERS,
17+
A11yHelper
18+
]
1219
})
1320
@RouteConfig([
1421
{path:'/', name: 'Index', component: A11yIndex},

public/docs/_examples/cb-a11y/ts/app/form-controls/a11y-form-controls.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h3>Labeling custom controls</h3>
5151
<hr>
5252
</header>
5353
</section>
54-
54+
<a href="" [routerLink]="['Index']">Back to index...</a>
5555
</article>
5656

5757

public/docs/_examples/cb-a11y/ts/app/form-controls/a11y-form-controls.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import {A11ySelect} from "./a11y-select.component";
88
import {A11yTextarea} from "./a11y-textarea.component";
99
import {A11yHiddenLabels} from "./a11y-hidden-labels.component";
1010
import {A11yHelper} from "../services/a11y-helper.service";
11+
import {ROUTER_DIRECTIVES} from "angular2/router";
1112

1213
@Component({
1314
selector: 'a11y-form-controls',
1415
templateUrl: './app/form-controls/a11y-form-controls.component.html',
1516
directives: [
1617
CORE_DIRECTIVES,
1718
FORM_DIRECTIVES,
19+
ROUTER_DIRECTIVES,
1820
A11yInput,
1921
A11yInputExplicit,
2022
A11yCheckboxes,

public/docs/ts/latest/cookbook/a11y.jade

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
include ../_util-fns
22

33
:marked
4-
Welcome, you are about to learn some key concepts that will make your Angular&nbsp;2 application accessible for
4+
Welcome! You are about to learn some key concepts that will make your Angular&nbsp;2 application accessible for
55
as many people as possible. This is no small goal, there is a large group of people out there who find it
66
very hard or even impossible to use your applications without thinking about the concepts mentioned here.
77

8-
We would like to show you that this can often be achieved with little to no extra effort on your part
8+
We will show you that this can often be achieved with little to no extra effort on your part,
99
if you bring these concepts right into the design phase of your application.
1010

1111
So page through this cookbook, apply the recipes contained herein and watch your userbase grow.
@@ -14,29 +14,58 @@ include ../_util-fns
1414
incredible journey. And for those who already enjoy the benefits of `Accessible Web Applications`, we will
1515
show you how to apply your knowledge in the new and exciting world of Angular&nbsp;2.
1616

17+
.l-main-section
1718
:marked
18-
## A11y in a nutshell
19+
## A11y and ARIA in a nutshell
1920

20-
`Accessibility` is often referred to as `a11y`. This is because we want to say as lot while writing less. And
21+
`Accessibility` is often referred to as `a11y`. This is because we want to say as lot while we write less. And
2122
as it has eleven letters, starts with an `a` and ends with a `y`, we shorten this word to `a11y`. We will
2223
refer to `a11y` when we actually want to say `accessibility`.
2324

24-
In short, `a11y` refers to creating web applications that everyone can use, including those with disabilities that would
25-
ke web navigation hard or impossible when these principles are not applied.
25+
In short, `a11y` refers to creating web applications that everyone can use.
2626

27-
If you are totally new to the concept you may want to have a look at what the folks are the `W3C` have to say about
28-
[a11y](http://www.w3.org/WAI/intro/accessibility.php) to put the rest of the article into perspective. We will be
27+
If you are totally new to the concept you may want to have a look at what the folks at the `W3C` have to say about
28+
[a11y](http://www.w3.org/WAI/intro/accessibility.php), to put the rest of the article into perspective. We will be
2929
right here waiting for you when you come back.
3030

31-
`ARIA`, or `Accessible Rich Internet Applications` refers to translating general `a11y` concerns to
31+
But what is that other word?
32+
33+
`ARIA`, or `Accessible Rich Internet Applications` refers to bringing `a11y` concepts right into
3234
internet applications like those we are building using Angular&nbsp;2.
3335

36+
.l-main-section
37+
:marked
38+
## Standard element vs. custom component
39+
40+
Angular&nbsp;2 gives you a lot of power at your fingertips to create extremely powerful components. But spare a
41+
thought for the standard `HTML` elements before you decide to build something new.
42+
43+
The makers of the browsers have spent a lot of time thinking about the very same issue that has brought
44+
us to this page today and have provided you with a lot of functionality out-of-the-box when you make use of
45+
standard `HTML` elements in your component templates.
46+
47+
We would like to suggest the following rule of thumb when building your applications:
48+
49+
>If there is already a standard element inside `HTML` providing the function that you are trying to build, use
50+
that element instead of writing your own.
51+
52+
So, for example, if you want to accept user text input, use the `INPUT` element instead of contructing something new.
53+
And when you do write new components, use the standard `HTML` elements in your templates as often as possible.
54+
55+
This way you have to think less about things like focus management, tabindex, etc. and have more time to think about
56+
your code.
57+
58+
But, we know this is not always possible, so this guide will also show you what you can do to make your own
59+
components as accessible as possible.
60+
61+
So without further ado, let us see how easy it is to get big accessibility gains in our applications!
62+
3463
.l-main-section
3564
<a id="toc"></a>
3665
:marked
3766
## Table of contents
3867

39-
[Using text as a label for a custom component](#custom-component-label)
68+
[Accessible form control labels](#form-control-label)
4069

4170
[Using keyboard shortcuts](#keyboard-shortcuts)
4271

@@ -45,10 +74,12 @@ include ../_util-fns
4574
[Managing focus](#managin-focus)
4675

4776
.l-main-section
48-
<a id="custom-component-label"></a>
77+
<a id="form-control-label"></a>
4978
:marked
5079
## Using text as a label for a custom component
5180

81+
82+
5283
.l-main-section
5384
<a id="keyboard-shortcuts"></a>
5485
:marked

0 commit comments

Comments
 (0)