Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 1192ae4

Browse files
docs(bike-shed-migration): convert <doc:...> examples to <example>...
1 parent f7c8bcb commit 1192ae4

27 files changed

+326
-326
lines changed

src/Angular.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,8 @@ function isLeafNode (node) {
719719
* @returns {*} The copy or updated `destination`, if `destination` was specified.
720720
*
721721
* @example
722-
<doc:example>
723-
<doc:source>
722+
<example>
723+
<file name="index.html">
724724
<div ng-controller="Controller">
725725
<form novalidate class="simple-form">
726726
Name: <input type="text" ng-model="user.name" /><br />
@@ -751,8 +751,8 @@ function isLeafNode (node) {
751751
$scope.reset();
752752
}
753753
</script>
754-
</doc:source>
755-
</doc:example>
754+
</file>
755+
</example>
756756
*/
757757
function copy(source, destination){
758758
if (isWindow(source) || isScope(source)) {

src/ng/compile.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@
383383
* to illustrate how `$compile` works.
384384
* </div>
385385
*
386-
<doc:example module="compile">
387-
<doc:source>
386+
<example module="compile">
387+
<file name="index.html">
388388
<script>
389389
angular.module('compile', [], function($compileProvider) {
390390
// configure new 'compile' directive by passing a directive
@@ -423,8 +423,8 @@
423423
<textarea ng-model="html"></textarea> <br>
424424
<div compile="html"></div>
425425
</div>
426-
</doc:source>
427-
<doc:protractor>
426+
</file>
427+
</file name="protractor.js" type="protractor">
428428
it('should auto compile', function() {
429429
var textarea = $('textarea');
430430
var output = $('div[compile]');
@@ -434,8 +434,8 @@
434434
textarea.sendKeys('{{name}}!');
435435
expect(output.getText()).toBe('Angular!');
436436
});
437-
</doc:protractor>
438-
</doc:example>
437+
</file>
438+
</example>
439439
440440
*
441441
*

src/ng/directive/booleanAttrs.js

+36-36
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
* @example
3232
* This example shows various combinations of `href`, `ng-href` and `ng-click` attributes
3333
* in links and their different behaviors:
34-
<doc:example>
35-
<doc:source>
34+
<example>
35+
<file name="index.html">
3636
<input ng-model="value" /><br />
3737
<a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
3838
<a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
3939
<a id="link-3" ng-href="/{{'123'}}">link 3</a> (link, reload!)<br />
4040
<a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
4141
<a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
4242
<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">
4545
it('should execute ng-click but not reload when href without value', function() {
4646
element(by.id('link-1')).click();
4747
expect(element(by.model('value')).getAttribute('value')).toEqual('1');
@@ -89,8 +89,8 @@
8989
element(by.id('link-6')).click();
9090
expect(browser.getCurrentUrl()).toMatch(/\/6$/);
9191
});
92-
</doc:protractor>
93-
</doc:example>
92+
</file>
93+
</example>
9494
*/
9595

9696
/**
@@ -169,19 +169,19 @@
169169
* a permanent reliable place to store the binding information.
170170
*
171171
* @example
172-
<doc:example>
173-
<doc:source>
172+
<example>
173+
<file name="index.html">
174174
Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
175175
<button ng-model="button" ng-disabled="checked">Button</button>
176-
</doc:source>
177-
<doc:protractor>
176+
</file>
177+
</file name="protractor.js" type="protractor">
178178
it('should toggle button', function() {
179179
expect(element(by.css('.doc-example-live button')).getAttribute('disabled')).toBeFalsy();
180180
element(by.model('checked')).click();
181181
expect(element(by.css('.doc-example-live button')).getAttribute('disabled')).toBeTruthy();
182182
});
183-
</doc:protractor>
184-
</doc:example>
183+
</file>
184+
</example>
185185
*
186186
* @element INPUT
187187
* @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
@@ -204,19 +204,19 @@
204204
* This complementary directive is not removed by the browser and so provides
205205
* a permanent reliable place to store the binding information.
206206
* @example
207-
<doc:example>
208-
<doc:source>
207+
<example>
208+
<file name="index.html">
209209
Check me to check both: <input type="checkbox" ng-model="master"><br/>
210210
<input id="checkSlave" type="checkbox" ng-checked="master">
211-
</doc:source>
212-
<doc:protractor>
211+
</file>
212+
</file name="protractor.js" type="protractor">
213213
it('should check both checkBoxes', function() {
214214
expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();
215215
element(by.model('master')).click();
216216
expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();
217217
});
218-
</doc:protractor>
219-
</doc:example>
218+
</file>
219+
</example>
220220
*
221221
* @element INPUT
222222
* @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
@@ -239,19 +239,19 @@
239239
* This complementary directive is not removed by the browser and so provides
240240
* a permanent reliable place to store the binding information.
241241
* @example
242-
<doc:example>
243-
<doc:source>
242+
<example>
243+
<file name="index.html">
244244
Check me to make text readonly: <input type="checkbox" ng-model="checked"><br/>
245245
<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">
248248
it('should toggle readonly attr', function() {
249249
expect(element(by.css('.doc-example-live [type="text"]')).getAttribute('readonly')).toBeFalsy();
250250
element(by.model('checked')).click();
251251
expect(element(by.css('.doc-example-live [type="text"]')).getAttribute('readonly')).toBeTruthy();
252252
});
253-
</doc:protractor>
254-
</doc:example>
253+
</file>
254+
</example>
255255
*
256256
* @element INPUT
257257
* @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
@@ -275,22 +275,22 @@
275275
* a permanent reliable place to store the binding information.
276276
*
277277
* @example
278-
<doc:example>
279-
<doc:source>
278+
<example>
279+
<file name="index.html">
280280
Check me to select: <input type="checkbox" ng-model="selected"><br/>
281281
<select>
282282
<option>Hello!</option>
283283
<option id="greet" ng-selected="selected">Greetings!</option>
284284
</select>
285-
</doc:source>
286-
<doc:protractor>
285+
</file>
286+
</file name="protractor.js" type="protractor">
287287
it('should select Greetings!', function() {
288288
expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();
289289
element(by.model('selected')).click();
290290
expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();
291291
});
292-
</doc:protractor>
293-
</doc:example>
292+
</file>
293+
</example>
294294
*
295295
* @element OPTION
296296
* @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
@@ -312,21 +312,21 @@
312312
* This complementary directive is not removed by the browser and so provides
313313
* a permanent reliable place to store the binding information.
314314
* @example
315-
<doc:example>
316-
<doc:source>
315+
<example>
316+
<file name="index.html">
317317
Check me check multiple: <input type="checkbox" ng-model="open"><br/>
318318
<details id="details" ng-open="open">
319319
<summary>Show/Hide me</summary>
320320
</details>
321-
</doc:source>
322-
<doc:protractor>
321+
</file>
322+
</file name="protractor.js" type="protractor">
323323
it('should toggle open', function() {
324324
expect(element(by.id('details')).getAttribute('open')).toBeFalsy();
325325
element(by.model('open')).click();
326326
expect(element(by.id('details')).getAttribute('open')).toBeTruthy();
327327
});
328-
</doc:protractor>
329-
</doc:example>
328+
</file>
329+
</example>
330330
*
331331
* @element DETAILS
332332
* @param {expression} ngOpen If the {@link guide/expression expression} is truthy,

src/ng/directive/form.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ function FormController(element, attrs) {
283283
* related scope, under this name.
284284
*
285285
* @example
286-
<doc:example>
287-
<doc:source>
286+
<example>
287+
<file name="index.html">
288288
<script>
289289
function Ctrl($scope) {
290290
$scope.userType = 'guest';
@@ -299,8 +299,8 @@ function FormController(element, attrs) {
299299
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
300300
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
301301
</form>
302-
</doc:source>
303-
<doc:protractor>
302+
</file>
303+
</file name="protractor.js" type="protractor">
304304
it('should initialize to model', function() {
305305
var userType = element(by.binding('userType'));
306306
var valid = element(by.binding('myForm.input.$valid'));
@@ -320,8 +320,8 @@ function FormController(element, attrs) {
320320
expect(userType.getText()).toEqual('userType =');
321321
expect(valid.getText()).toContain('false');
322322
});
323-
</doc:protractor>
324-
</doc:example>
323+
</file>
324+
</example>
325325
*/
326326
var formDirectiveFactory = function(isNgForm) {
327327
return ['$timeout', function($timeout) {

0 commit comments

Comments
 (0)