1
1
include ../_util-fns
2
2
3
3
:marked
4
- Welcome, you are about to learn some key concepts that will make your Angular 2 application accessible for
4
+ Welcome! You are about to learn some key concepts that will make your Angular 2 application accessible for
5
5
as many people as possible. This is no small goal, there is a large group of people out there who find it
6
6
very hard or even impossible to use your applications without thinking about the concepts mentioned here.
7
7
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,
9
9
if you bring these concepts right into the design phase of your application.
10
10
11
11
So page through this cookbook, apply the recipes contained herein and watch your userbase grow.
@@ -14,29 +14,58 @@ include ../_util-fns
14
14
incredible journey. And for those who already enjoy the benefits of `Accessible Web Applications`, we will
15
15
show you how to apply your knowledge in the new and exciting world of Angular 2.
16
16
17
+ .l-main-section
17
18
:marked
18
- ## A11y in a nutshell
19
+ ## A11y and ARIA in a nutshell
19
20
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
21
22
as it has eleven letters, starts with an `a` and ends with a `y`, we shorten this word to `a11y`. We will
22
23
refer to `a11y` when we actually want to say `accessibility`.
23
24
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.
26
26
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
29
29
right here waiting for you when you come back.
30
30
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
32
34
internet applications like those we are building using Angular 2.
33
35
36
+ .l-main-section
37
+ :marked
38
+ ## Standard element vs. custom component
39
+
40
+ Angular 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
+
34
63
.l-main-section
35
64
<a id =" toc" ></a >
36
65
:marked
37
66
## Table of contents
38
67
39
- [Using text as a label for a custom component ](#custom-component -label)
68
+ [Accessible form control labels ](#form-control -label)
40
69
41
70
[Using keyboard shortcuts](#keyboard-shortcuts)
42
71
@@ -45,10 +74,12 @@ include ../_util-fns
45
74
[Managing focus](#managin-focus)
46
75
47
76
.l-main-section
48
- <a id =" custom-component -label" ></a >
77
+ <a id =" form-control -label" ></a >
49
78
:marked
50
79
## Using text as a label for a custom component
51
80
81
+
82
+
52
83
.l-main-section
53
84
<a id =" keyboard-shortcuts" ></a >
54
85
:marked
0 commit comments