|
31 | 31 | * @example
|
32 | 32 | * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes
|
33 | 33 | * in links and their different behaviors:
|
34 |
| - <doc:example> |
35 |
| - <doc:source> |
| 34 | + <example> |
| 35 | + <file name="index.html"> |
36 | 36 | <input ng-model="value" /><br />
|
37 | 37 | <a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
|
38 | 38 | <a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
|
39 | 39 | <a id="link-3" ng-href="/{{'123'}}">link 3</a> (link, reload!)<br />
|
40 | 40 | <a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
|
41 | 41 | <a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
|
42 | 42 | <a id="link-6" ng-href="{{value}}">link</a> (link, change location)
|
43 |
| - </doc:source> |
44 |
| - <doc:protractor> |
| 43 | + </file> |
| 44 | + </file name="protractor.js" type="protractor"> |
45 | 45 | it('should execute ng-click but not reload when href without value', function() {
|
46 | 46 | element(by.id('link-1')).click();
|
47 | 47 | expect(element(by.model('value')).getAttribute('value')).toEqual('1');
|
|
89 | 89 | element(by.id('link-6')).click();
|
90 | 90 | expect(browser.getCurrentUrl()).toMatch(/\/6$/);
|
91 | 91 | });
|
92 |
| - </doc:protractor> |
93 |
| - </doc:example> |
| 92 | + </file> |
| 93 | + </example> |
94 | 94 | */
|
95 | 95 |
|
96 | 96 | /**
|
|
169 | 169 | * a permanent reliable place to store the binding information.
|
170 | 170 | *
|
171 | 171 | * @example
|
172 |
| - <doc:example> |
173 |
| - <doc:source> |
| 172 | + <example> |
| 173 | + <file name="index.html"> |
174 | 174 | Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
|
175 | 175 | <button ng-model="button" ng-disabled="checked">Button</button>
|
176 |
| - </doc:source> |
177 |
| - <doc:protractor> |
| 176 | + </file> |
| 177 | + </file name="protractor.js" type="protractor"> |
178 | 178 | it('should toggle button', function() {
|
179 | 179 | expect(element(by.css('.doc-example-live button')).getAttribute('disabled')).toBeFalsy();
|
180 | 180 | element(by.model('checked')).click();
|
181 | 181 | expect(element(by.css('.doc-example-live button')).getAttribute('disabled')).toBeTruthy();
|
182 | 182 | });
|
183 |
| - </doc:protractor> |
184 |
| - </doc:example> |
| 183 | + </file> |
| 184 | + </example> |
185 | 185 | *
|
186 | 186 | * @element INPUT
|
187 | 187 | * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
|
|
204 | 204 | * This complementary directive is not removed by the browser and so provides
|
205 | 205 | * a permanent reliable place to store the binding information.
|
206 | 206 | * @example
|
207 |
| - <doc:example> |
208 |
| - <doc:source> |
| 207 | + <example> |
| 208 | + <file name="index.html"> |
209 | 209 | Check me to check both: <input type="checkbox" ng-model="master"><br/>
|
210 | 210 | <input id="checkSlave" type="checkbox" ng-checked="master">
|
211 |
| - </doc:source> |
212 |
| - <doc:protractor> |
| 211 | + </file> |
| 212 | + </file name="protractor.js" type="protractor"> |
213 | 213 | it('should check both checkBoxes', function() {
|
214 | 214 | expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();
|
215 | 215 | element(by.model('master')).click();
|
216 | 216 | expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();
|
217 | 217 | });
|
218 |
| - </doc:protractor> |
219 |
| - </doc:example> |
| 218 | + </file> |
| 219 | + </example> |
220 | 220 | *
|
221 | 221 | * @element INPUT
|
222 | 222 | * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
|
|
239 | 239 | * This complementary directive is not removed by the browser and so provides
|
240 | 240 | * a permanent reliable place to store the binding information.
|
241 | 241 | * @example
|
242 |
| - <doc:example> |
243 |
| - <doc:source> |
| 242 | + <example> |
| 243 | + <file name="index.html"> |
244 | 244 | Check me to make text readonly: <input type="checkbox" ng-model="checked"><br/>
|
245 | 245 | <input type="text" ng-readonly="checked" value="I'm Angular"/>
|
246 |
| - </doc:source> |
247 |
| - <doc:protractor> |
| 246 | + </file> |
| 247 | + </file name="protractor.js" type="protractor"> |
248 | 248 | it('should toggle readonly attr', function() {
|
249 | 249 | expect(element(by.css('.doc-example-live [type="text"]')).getAttribute('readonly')).toBeFalsy();
|
250 | 250 | element(by.model('checked')).click();
|
251 | 251 | expect(element(by.css('.doc-example-live [type="text"]')).getAttribute('readonly')).toBeTruthy();
|
252 | 252 | });
|
253 |
| - </doc:protractor> |
254 |
| - </doc:example> |
| 253 | + </file> |
| 254 | + </example> |
255 | 255 | *
|
256 | 256 | * @element INPUT
|
257 | 257 | * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
|
|
275 | 275 | * a permanent reliable place to store the binding information.
|
276 | 276 | *
|
277 | 277 | * @example
|
278 |
| - <doc:example> |
279 |
| - <doc:source> |
| 278 | + <example> |
| 279 | + <file name="index.html"> |
280 | 280 | Check me to select: <input type="checkbox" ng-model="selected"><br/>
|
281 | 281 | <select>
|
282 | 282 | <option>Hello!</option>
|
283 | 283 | <option id="greet" ng-selected="selected">Greetings!</option>
|
284 | 284 | </select>
|
285 |
| - </doc:source> |
286 |
| - <doc:protractor> |
| 285 | + </file> |
| 286 | + </file name="protractor.js" type="protractor"> |
287 | 287 | it('should select Greetings!', function() {
|
288 | 288 | expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();
|
289 | 289 | element(by.model('selected')).click();
|
290 | 290 | expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();
|
291 | 291 | });
|
292 |
| - </doc:protractor> |
293 |
| - </doc:example> |
| 292 | + </file> |
| 293 | + </example> |
294 | 294 | *
|
295 | 295 | * @element OPTION
|
296 | 296 | * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
|
|
312 | 312 | * This complementary directive is not removed by the browser and so provides
|
313 | 313 | * a permanent reliable place to store the binding information.
|
314 | 314 | * @example
|
315 |
| - <doc:example> |
316 |
| - <doc:source> |
| 315 | + <example> |
| 316 | + <file name="index.html"> |
317 | 317 | Check me check multiple: <input type="checkbox" ng-model="open"><br/>
|
318 | 318 | <details id="details" ng-open="open">
|
319 | 319 | <summary>Show/Hide me</summary>
|
320 | 320 | </details>
|
321 |
| - </doc:source> |
322 |
| - <doc:protractor> |
| 321 | + </file> |
| 322 | + </file name="protractor.js" type="protractor"> |
323 | 323 | it('should toggle open', function() {
|
324 | 324 | expect(element(by.id('details')).getAttribute('open')).toBeFalsy();
|
325 | 325 | element(by.model('open')).click();
|
326 | 326 | expect(element(by.id('details')).getAttribute('open')).toBeTruthy();
|
327 | 327 | });
|
328 |
| - </doc:protractor> |
329 |
| - </doc:example> |
| 328 | + </file> |
| 329 | + </example> |
330 | 330 | *
|
331 | 331 | * @element DETAILS
|
332 | 332 | * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
|
|
0 commit comments