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

Commit 07ada0b

Browse files
committed
docs(cb-a11y): Content - Form controls
1 parent 6865ca1 commit 07ada0b

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ <h3>Implicit labeling</h3>
88
<hr>
99
</header>
1010

11+
<!-- #docregion cb-a11y-form-controls-input-usage -->
1112
<a11y-input>Type something:</a11y-input>
13+
<!--#enddocregion-->
1214

1315
<a11y-textarea>Type some text:</a11y-textarea>
1416

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ include ../_util-fns
109109

110110
We will discuss a number of ways to do this.
111111

112+
**NOTE**: You will see `ng-content` make its appearance a lot in the examples. We are making use of `Content Projection`
113+
to load content into the templates of our components.
114+
112115
:marked
113116
### Implicit labelling
114117

@@ -120,7 +123,7 @@ include ../_util-fns
120123
With this writing style you simply wrap the `HTML` element inside a label tag and you are done. There is no need to
121124
generate or suppply field id's as you will see with the other methods.
122125

123-
Your general `HTML` becomes:
126+
Implicit labelling is done as follows:
124127

125128
code-example(language="html" escape="html").
126129
<label>label text
@@ -130,13 +133,33 @@ code-example(language="html" escape="html").
130133
:marked
131134
Of course, here the `INPUT` element can be any native `HTML` form element.
132135

133-
So let us see how we would write the commonly used native `HTML` form elements in our Angular&nbsp;2 components.
136+
Let us see how we would write the commonly used native `HTML` form elements in our Angular&nbsp;2 components.
134137

135138
:marked
136139
#### Inputs
137140

141+
Your component template:
142+
138143
+makeExample('cb-a11y/ts/app/form-controls/a11y-input.component.html')
139144

145+
:marked
146+
Used as:
147+
148+
+makeExample('cb-a11y/ts/app/form-controls/a11y-form-controls.component.html','cb-a11y-form-controls-input-usage')
149+
150+
:marked
151+
Which is then rendered as:
152+
153+
code-example(language="html" escape="html").
154+
<a11y-input>
155+
<div class="form-group ">
156+
<label>
157+
Type something:
158+
<input class="form-control">
159+
</label>
160+
</div>
161+
</a11y-input>
162+
140163
:marked
141164
#### Textareas
142165

0 commit comments

Comments
 (0)