Skip to content

Commit ccf743d

Browse files
Merge pull request #58 from angular/master
Update upstream
2 parents 8858d43 + 02f4ca4 commit ccf743d

File tree

11 files changed

+360
-23
lines changed

11 files changed

+360
-23
lines changed

docs/app/assets/robots.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
User-agent: *
22

3-
Disallow: /components/
43
Disallow: /examples/
54
Disallow: /img/
6-
Disallow: /js/
75
Disallow: /partials/
86
Disallow: /ptore2e/
9-
Disallow: /*.js$
10-
Disallow: /*.map$
7+
Disallow: /*.js$ # The js files in the root are used by the embedded examples, not by the app itself
8+
Disallow: /*.map$ # The map files in the root are used by the embedded examples, not by the app itself
119
Disallow: /Error404.html

docs/config/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module.exports = new Package('angularjs', [
3131
.processor(require('./processors/keywords'))
3232
.processor(require('./processors/pages-data'))
3333
.processor(require('./processors/versions-data'))
34+
.processor(require('./processors/sitemap'))
3435

3536

3637
.config(function(dgeni, log, readFilesProcessor, writeFilesProcessor) {

docs/config/processors/sitemap.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
3+
var exclusionRegex = /^index|examples\/|ptore2e\//;
4+
5+
module.exports = function createSitemap() {
6+
return {
7+
$runAfter: ['paths-computed'],
8+
$runBefore: ['rendering-docs'],
9+
$process: function(docs) {
10+
docs.push({
11+
id: 'sitemap.xml',
12+
path: 'sitemap.xml',
13+
outputPath: '../sitemap.xml',
14+
template: 'sitemap.template.xml',
15+
urls: docs.filter(function(doc) {
16+
return doc.path &&
17+
doc.outputPath &&
18+
!exclusionRegex.test(doc.outputPath);
19+
}).map(function(doc) {
20+
return doc.path;
21+
})
22+
});
23+
}
24+
};
25+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
{%- for url in doc.urls %}
4+
<url>
5+
<loc>https://docs.angularjs.org/{$ url $}</loc>
6+
</url>{% endfor %}
7+
</urlset>

docs/content/guide/animations.ngdoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,12 @@ triggered:
229229
| {@link ngRoute.directive:ngView#animations ngView} | enter and leave |
230230
| {@link module:ngMessages#animations ngMessage / ngMessageExp} | enter and leave |
231231
| {@link ng.directive:ngClass#animations ngClass / {{class&#125;&#8203;&#125;} | add and remove |
232-
| {@link ng.directive:ngClass#animations ngClassEven / ngClassOdd} | add and remove |
232+
| {@link ng.directive:ngClassEven#animations ngClassEven} | add and remove |
233+
| {@link ng.directive:ngClassOdd#animations ngClassOdd} | add and remove |
233234
| {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) |
234235
| {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) |
235-
| {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |
236-
| {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |
236+
| {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |
237+
| {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |
237238
| {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) |
238239

239240
For a full breakdown of the steps involved during each animation event, refer to the
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
User-agent: *
22

3-
Disallow: /*docs/
3+
Disallow: /*docs*/
44
Disallow: /*i18n/
55
Disallow: /*.zip$
6+
Allow: /snapshot/docs/js/all-versions-data.js

src/ng/directive/ngClass.js

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ var ngClassDirective = classDirective('', true);
338338
* This directive can be applied only within the scope of an
339339
* {@link ng.directive:ngRepeat ngRepeat}.
340340
*
341+
* @animations
342+
* | Animation | Occurs |
343+
* |----------------------------------|-------------------------------------|
344+
* | {@link ng.$animate#addClass addClass} | just before the class is applied to the element |
345+
* | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element |
346+
*
341347
* @element ANY
342348
* @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result
343349
* of the evaluation can be a string representing space delimited class names or an array.
@@ -370,6 +376,62 @@ var ngClassDirective = classDirective('', true);
370376
});
371377
</file>
372378
</example>
379+
*
380+
* <hr />
381+
* @example
382+
* An example on how to implement animations using `ngClassOdd`:
383+
*
384+
<example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-class-odd-animate">
385+
<file name="index.html">
386+
<div ng-init="items=['Item 3', 'Item 2', 'Item 1', 'Item 0']">
387+
<button ng-click="items.unshift('Item ' + items.length)">Add item</button>
388+
<hr />
389+
<table>
390+
<tr ng-repeat="item in items" ng-class-odd="'odd'">
391+
<td>{{ item }}</td>
392+
</tr>
393+
</table>
394+
</div>
395+
</file>
396+
<file name="style.css">
397+
.odd {
398+
background: rgba(255, 255, 0, 0.25);
399+
}
400+
401+
.odd-add, .odd-remove {
402+
transition: 1.5s;
403+
}
404+
</file>
405+
<file name="protractor.js" type="protractor">
406+
it('should add new entries to the beginning of the list', function() {
407+
var button = element(by.buttonText('Add item'));
408+
var rows = element.all(by.repeater('item in items'));
409+
410+
expect(rows.count()).toBe(4);
411+
expect(rows.get(0).getText()).toBe('Item 3');
412+
expect(rows.get(1).getText()).toBe('Item 2');
413+
414+
button.click();
415+
416+
expect(rows.count()).toBe(5);
417+
expect(rows.get(0).getText()).toBe('Item 4');
418+
expect(rows.get(1).getText()).toBe('Item 3');
419+
});
420+
421+
it('should add odd class to odd entries', function() {
422+
var button = element(by.buttonText('Add item'));
423+
var rows = element.all(by.repeater('item in items'));
424+
425+
expect(rows.get(0).getAttribute('class')).toMatch(/odd/);
426+
expect(rows.get(1).getAttribute('class')).not.toMatch(/odd/);
427+
428+
button.click();
429+
430+
expect(rows.get(0).getAttribute('class')).toMatch(/odd/);
431+
expect(rows.get(1).getAttribute('class')).not.toMatch(/odd/);
432+
});
433+
</file>
434+
</example>
373435
*/
374436
var ngClassOddDirective = classDirective('Odd', 0);
375437

@@ -386,6 +448,12 @@ var ngClassOddDirective = classDirective('Odd', 0);
386448
* This directive can be applied only within the scope of an
387449
* {@link ng.directive:ngRepeat ngRepeat}.
388450
*
451+
* @animations
452+
* | Animation | Occurs |
453+
* |----------------------------------|-------------------------------------|
454+
* | {@link ng.$animate#addClass addClass} | just before the class is applied to the element |
455+
* | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element |
456+
*
389457
* @element ANY
390458
* @param {expression} ngClassEven {@link guide/expression Expression} to eval. The
391459
* result of the evaluation can be a string representing space delimited class names or an array.
@@ -418,5 +486,61 @@ var ngClassOddDirective = classDirective('Odd', 0);
418486
});
419487
</file>
420488
</example>
489+
*
490+
* <hr />
491+
* @example
492+
* An example on how to implement animations using `ngClassEven`:
493+
*
494+
<example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-class-even-animate">
495+
<file name="index.html">
496+
<div ng-init="items=['Item 3', 'Item 2', 'Item 1', 'Item 0']">
497+
<button ng-click="items.unshift('Item ' + items.length)">Add item</button>
498+
<hr />
499+
<table>
500+
<tr ng-repeat="item in items" ng-class-even="'even'">
501+
<td>{{ item }}</td>
502+
</tr>
503+
</table>
504+
</div>
505+
</file>
506+
<file name="style.css">
507+
.even {
508+
background: rgba(255, 255, 0, 0.25);
509+
}
510+
511+
.even-add, .even-remove {
512+
transition: 1.5s;
513+
}
514+
</file>
515+
<file name="protractor.js" type="protractor">
516+
it('should add new entries to the beginning of the list', function() {
517+
var button = element(by.buttonText('Add item'));
518+
var rows = element.all(by.repeater('item in items'));
519+
520+
expect(rows.count()).toBe(4);
521+
expect(rows.get(0).getText()).toBe('Item 3');
522+
expect(rows.get(1).getText()).toBe('Item 2');
523+
524+
button.click();
525+
526+
expect(rows.count()).toBe(5);
527+
expect(rows.get(0).getText()).toBe('Item 4');
528+
expect(rows.get(1).getText()).toBe('Item 3');
529+
});
530+
531+
it('should add even class to even entries', function() {
532+
var button = element(by.buttonText('Add item'));
533+
var rows = element.all(by.repeater('item in items'));
534+
535+
expect(rows.get(0).getAttribute('class')).not.toMatch(/even/);
536+
expect(rows.get(1).getAttribute('class')).toMatch(/even/);
537+
538+
button.click();
539+
540+
expect(rows.get(0).getAttribute('class')).not.toMatch(/even/);
541+
expect(rows.get(1).getAttribute('class')).toMatch(/even/);
542+
});
543+
</file>
544+
</example>
421545
*/
422546
var ngClassEvenDirective = classDirective('Even', 1);

src/ng/templateRequest.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ function $TemplateRequestProvider() {
9999
handleRequestFn.totalPendingRequests--;
100100
})
101101
.then(function(response) {
102-
$templateCache.put(tpl, response.data);
103-
return response.data;
102+
return $templateCache.put(tpl, response.data);
104103
}, handleError);
105104

106105
function handleError(resp) {

0 commit comments

Comments
 (0)