@@ -109,6 +109,9 @@ include ../_util-fns
109
109
110
110
We will discuss a number of ways to do this.
111
111
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
+
112
115
:marked
113
116
### Implicit labelling
114
117
@@ -120,7 +123,7 @@ include ../_util-fns
120
123
With this writing style you simply wrap the `HTML` element inside a label tag and you are done. There is no need to
121
124
generate or suppply field id's as you will see with the other methods.
122
125
123
- Your general `HTML` becomes :
126
+ Implicit labelling is done as follows :
124
127
125
128
code-example( language ="html" escape ="html" ) .
126
129
<label >label text
@@ -130,13 +133,33 @@ code-example(language="html" escape="html").
130
133
:marked
131
134
Of course, here the `INPUT` element can be any native `HTML` form element.
132
135
133
- So let us see how we would write the commonly used native `HTML` form elements in our Angular 2 components.
136
+ Let us see how we would write the commonly used native `HTML` form elements in our Angular 2 components.
134
137
135
138
:marked
136
139
#### Inputs
137
140
141
+ Your component template:
142
+
138
143
+ makeExample('cb-a11y/ts/app/form-controls/a11y-input.component.html' )
139
144
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
+
140
163
:marked
141
164
#### Textareas
142
165
0 commit comments