Skip to content

Commit 0cdace6

Browse files
Merge pull request #3 from angular/master
Update dari upstream
2 parents 1067b9c + 3d0abff commit 0cdace6

File tree

12 files changed

+166
-82
lines changed

12 files changed

+166
-82
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
bower_components/**
22
build/**
3-
docs/bower_components/**
43
docs/app/assets/js/angular-bootstrap/**
54
docs/config/templates/**
65
node_modules/**

.github/ISSUE_TEMPLATE.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
1-
***Note*: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.**
2-
3-
**Do you want to request a *feature* or report a *bug*?**
4-
5-
6-
7-
**What is the current behavior?**
8-
9-
10-
11-
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).**
12-
13-
14-
15-
**What is the expected behavior?**
16-
17-
18-
19-
**What is the motivation / use case for changing the behavior?**
20-
21-
22-
23-
**Which versions of AngularJS, and which browser / OS are affected by this issue? Did this work in previous versions of AngularJS? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.**
24-
25-
26-
27-
**Other information (e.g. stacktraces, related issues, suggestions how to fix)**
1+
<!--
2+
IF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATION
3+
-->
4+
5+
<!--
6+
- For *SUPPORT QUESTIONS*, use one of the
7+
[support channels](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question).
8+
- Before submitting, please **SEARCH GITHUB** for a similar issue or PR. -->
9+
10+
**I'm submitting a ...**
11+
<!-- (check one with "x") -->
12+
- [ ] bug report
13+
- [ ] feature request
14+
- [ ] other (Please do not submit support requests here (see above))
15+
16+
**Current behavior:**
17+
<!-- Describe how the bug manifests / how the current features are insufficient. -->
18+
19+
**Expected / new behavior:**
20+
<!-- Describe what the behavior would be without the bug / how the feature would improve AngularJS -->
21+
22+
**Minimal reproduction of the problem with instructions:**
23+
<!--
24+
If the current behavior is a bug or you can illustrate your feature request better with an example,
25+
please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
26+
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:yBpEi4).
27+
-->
28+
29+
**Angular version:** 1.x.y
30+
<!-- Check whether this is still an issue in the most recent stable or in the snapshot AngularJS version (https://code.angularjs.org/snapshot/) -->
31+
32+
**Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
33+
<!-- All browsers where this could be reproduced (and Operating System if relevant) -->
34+
35+
**Anything else:**
36+
<!-- e.g. stacktraces, related issues, suggestions how to fix -->

.travis.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ node_js:
44
- '6'
55

66
cache:
7+
yarn: true
78
directories:
8-
- node_modules
99
- bower_components
10-
- docs/bower_components
1110

1211
branches:
1312
except:
@@ -36,12 +35,8 @@ addons:
3635
packages:
3736
- g++-4.8
3837

39-
before_install:
40-
- curl -o- -L https://raw.githubusercontent.com/yarnpkg/yarn/2a0afc73210c7a82082585283e518eeb88ca19ae/scripts/install-latest.sh | bash -s -- --version 0.17.9
41-
- export PATH=$HOME/.yarn/bin:$PATH
42-
4338
before_script:
44-
- du -sh ./node_modules ./bower_components/ ./docs/bower_components/ || true
39+
- du -sh ./node_modules ./bower_components/ || true
4540
- ./scripts/travis/before_build.sh
4641

4742
script:

Gruntfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ module.exports = function(grunt) {
172172
'test/**/*.js',
173173
'i18n/**/*.js',
174174
'!docs/app/assets/js/angular-bootstrap/**',
175-
'!docs/bower_components/**',
176175
'!docs/config/templates/**',
177176
'!src/angular.bind.js',
178177
'!i18n/closure/**',
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@ngdoc error
2+
@name $compile:noslot
3+
@fullName No matching slot in parent directive
4+
@description
5+
6+
This error occurs when declaring a specific slot in a {@link ng.ngTransclude `ngTransclude`}
7+
which does not map to a specific slot defined in the transclude property of the directive.
8+
9+
In this example the template has declared a slot missing from the transclude definition.
10+
This example will generate a noslot error.
11+
```js
12+
var componentConfig = {
13+
template: '<div>' +
14+
'<div ng-transclude="slotProvided"></div>' +
15+
'<div ng-transclude="noSlotProvided"></div>' +
16+
'</div>',
17+
transclude: {
18+
// The key value pairs here are considered "slots" that are provided for components to slot into.
19+
slotProvided: 'slottedComponent', // mandatory transclusion
20+
// There is no slot provided here for the transclude 'noSlotProvided' declared in the above template.
21+
}
22+
};
23+
```
24+
25+
If we make the following change we will no longer get the noslot error.
26+
```js
27+
var componentConfig = {
28+
template: '<div>' +
29+
'<div ng-transclude="slotProvided"></div>' +
30+
'<div ng-transclude="noSlotProvided"></div>' +
31+
'</div>',
32+
transclude: {
33+
slotProvided: 'slottedComponent',
34+
noSlotProvided: 'otherComponent' // now it is declared and the error should cease
35+
}
36+
};
37+
38+
```

docs/content/guide/component-router.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
# Component Router
77

8-
<div class="alert alert-info">
8+
<div class="alert alert-danger">
99
**Deprecation Notice:** In an effort to keep synchronized with router changes in the new Angular, this implementation of the Component Router (ngComponentRouter module) has been deprecated and will not receive further updates.
1010
We are investigating backporting the new Angular Router to AngularJS, but alternatively, use the {@link ngRoute} module or community developed projects (e.g. [ui-router](https://github.com/angular-ui/ui-router)).
1111
</div>
1212

1313
This guide describes the Component Router for AngularJS.
1414

1515
<div class="alert alert-info">
16-
If you are looking for information about the old router for AngularJS have a look at the {@link ngRoute} module.
16+
If you are looking for information about the default router for AngularJS have a look at the {@link ngRoute} module.
1717

1818
If you are looking for information about the Component Router for the new Angular then
1919
check out the [Angular Router Guide](https://angular.io/docs/ts/latest/guide/router.html).

docs/content/misc/faq.ngdoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ extracted from the commits. We can quickly see in the new changelog exactly what
5555
changes and so can application developers when they are deciding whether to update to a new version of
5656
AngularJS.
5757

58+
#### When are deprecated features removed from the library?
59+
Most of the time we remove a deprecated feature in a next minor version bump. For example, the
60+
`preAssignBindingsEnabled` `$compileProvider` method was defined in AngularJS `1.5.10`, deprecated in `1.6` and
61+
will be removed in `1.7`.
62+
63+
In case of jqLite we apply a different strategy - we deprecate features that have an equivalent in jQuery that
64+
is also deprecated but we only remove the feature once it's removed from jQuery to improve compatibility between
65+
jqLite and jQuery. One such example is the `bind` method, deprecated in favor of `on` but unlikely to be removed
66+
from jqLite any time soon.
67+
5868

5969
### Is AngularJS a templating system?
6070

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"engines": {
1212
"node": "^6.9.1",
13-
"yarn": ">=0.17.9",
13+
"yarn": ">=0.21.3",
1414
"grunt": "^1.2.0"
1515
},
1616
"scripts": {

scripts/jenkins/init-node.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nvm install
88

99
# clean out and install yarn
1010
rm -rf ~/.yarn
11-
curl -o- -L https://raw.githubusercontent.com/yarnpkg/yarn/2a0afc73210c7a82082585283e518eeb88ca19ae/scripts/install-latest.sh | bash -s -- --version 0.17.9
11+
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.21.3
1212
export PATH="$HOME/.yarn/bin:$PATH"
1313

1414
# Ensure that we have the local dependencies installed

src/ng/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function $ControllerProvider() {
5454
}
5555
};
5656

57-
this.$get = ['$injector', '$window', function($injector, $window) {
57+
this.$get = ['$injector', function($injector) {
5858

5959
/**
6060
* @ngdoc service

test/ng/compileSpec.js

Lines changed: 73 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,17 +2080,49 @@ describe('$compile', function() {
20802080
));
20812081

20822082

2083-
it('should work when directive is in a repeater', inject(
2084-
function($compile, $httpBackend, $rootScope) {
2085-
$httpBackend.expect('GET', 'hello.html').
2083+
describe('when directive is in a repeater', function() {
2084+
var is;
2085+
beforeEach(function() {
2086+
is = [1, 2];
2087+
});
2088+
2089+
function runTest() {
2090+
inject(function($compile, $httpBackend, $rootScope) {
2091+
$httpBackend.expect('GET', 'hello.html').
20862092
respond('<span>i=<span ng-transclude></span>;</span>');
2087-
element = jqLite('<div><b class=hello ng-repeat="i in [1,2]">{{i}}</b></div>');
2088-
$compile(element)($rootScope);
2093+
element = jqLite('<div><b class=hello ng-repeat="i in [' + is + ']">{{i}}</b></div>');
2094+
$compile(element)($rootScope);
20892095

2090-
$httpBackend.flush();
2091-
expect(element.text()).toEqual('i=1;i=2;');
2096+
$httpBackend.flush();
2097+
expect(element.text()).toEqual('i=' + is.join(';i=') + ';');
2098+
});
20922099
}
2093-
));
2100+
2101+
it('should work in jqLite and jQuery with jQuery.cleanData last patched by Angular', runTest);
2102+
2103+
if (jQuery) {
2104+
it('should work with another library patching jQuery.cleanData after Angular', function() {
2105+
var cleanedCount = 0;
2106+
var currentCleanData = jqLite.cleanData;
2107+
jqLite.cleanData = function(elems) {
2108+
cleanedCount += elems.length;
2109+
// Don't return the output and explicitly pass only the first parameter
2110+
// so that we're sure we're not relying on either of them. jQuery UI patch
2111+
// behaves in this way.
2112+
currentCleanData(elems);
2113+
};
2114+
2115+
runTest();
2116+
2117+
// The initial ng-repeat div is dumped after parsing hence we expect cleanData
2118+
// count to be one larger than size of the iterated array.
2119+
expect(cleanedCount).toBe(is.length + 1);
2120+
2121+
// Restore the previous cleanData.
2122+
jqLite.cleanData = currentCleanData;
2123+
});
2124+
}
2125+
});
20942126

20952127
describe('replace and not exactly one root element', function() {
20962128

@@ -8573,46 +8605,46 @@ describe('$compile', function() {
85738605
});
85748606
});
85758607

8576-
if (jQuery) {
8577-
describe('cleaning up after a replaced element', function() {
8578-
var $compile, xs;
8579-
beforeEach(inject(function(_$compile_) {
8580-
$compile = _$compile_;
8581-
xs = [0, 1];
8582-
}));
8608+
describe('cleaning up after a replaced element', function() {
8609+
var $compile, xs;
8610+
beforeEach(inject(function(_$compile_) {
8611+
$compile = _$compile_;
8612+
xs = [0, 1];
8613+
}));
85838614

8584-
function testCleanup() {
8585-
var privateData, firstRepeatedElem;
8615+
function testCleanup() {
8616+
var privateData, firstRepeatedElem;
85868617

8587-
element = $compile('<div><div ng-repeat="x in xs" ng-click="noop()">{{x}}</div></div>')($rootScope);
8618+
element = $compile('<div><div ng-repeat="x in xs" ng-click="noop()">{{x}}</div></div>')($rootScope);
85888619

8589-
$rootScope.$apply('xs = [' + xs + ']');
8590-
firstRepeatedElem = element.children('.ng-scope').eq(0);
8620+
$rootScope.$apply('xs = [' + xs + ']');
8621+
firstRepeatedElem = element.children('.ng-scope').eq(0);
85918622

8592-
expect(firstRepeatedElem.data('$scope')).toBeDefined();
8593-
privateData = jQuery._data(firstRepeatedElem[0]);
8594-
expect(privateData.events).toBeDefined();
8595-
expect(privateData.events.click).toBeDefined();
8596-
expect(privateData.events.click[0]).toBeDefined();
8623+
expect(firstRepeatedElem.data('$scope')).toBeDefined();
8624+
privateData = jqLite._data(firstRepeatedElem[0]);
8625+
expect(privateData.events).toBeDefined();
8626+
expect(privateData.events.click).toBeDefined();
8627+
expect(privateData.events.click[0]).toBeDefined();
85978628

8598-
//Ensure the AngularJS $destroy event is still sent
8599-
var destroyCount = 0;
8600-
element.find('div').on('$destroy', function() { destroyCount++; });
8629+
// Ensure the AngularJS $destroy event is still sent
8630+
var destroyCount = 0;
8631+
element.find('div').on('$destroy', function() { destroyCount++; });
86018632

8602-
$rootScope.$apply('xs = null');
8633+
$rootScope.$apply('xs = null');
86038634

8604-
expect(destroyCount).toBe(2);
8605-
expect(firstRepeatedElem.data('$scope')).not.toBeDefined();
8606-
privateData = jQuery._data(firstRepeatedElem[0]);
8607-
expect(privateData && privateData.events).not.toBeDefined();
8608-
}
8635+
expect(destroyCount).toBe(2);
8636+
expect(firstRepeatedElem.data('$scope')).not.toBeDefined();
8637+
privateData = jqLite._data(firstRepeatedElem[0]);
8638+
expect(privateData && privateData.events).not.toBeDefined();
8639+
}
86098640

8610-
it('should work without external libraries (except jQuery)', testCleanup);
8641+
it('should work without external libraries (except jQuery)', testCleanup);
86118642

8643+
if (jQuery) {
86128644
it('should work with another library patching jQuery.cleanData after AngularJS', function() {
86138645
var cleanedCount = 0;
8614-
var currentCleanData = jQuery.cleanData;
8615-
jQuery.cleanData = function(elems) {
8646+
var currentCleanData = jqLite.cleanData;
8647+
jqLite.cleanData = function(elems) {
86168648
cleanedCount += elems.length;
86178649
// Don't return the output and explicitly pass only the first parameter
86188650
// so that we're sure we're not relying on either of them. jQuery UI patch
@@ -8626,11 +8658,11 @@ describe('$compile', function() {
86268658
// and each clone of the ng-repeat template is also removed (xs.length)
86278659
expect(cleanedCount).toBe(xs.length + 1);
86288660

8629-
// Restore the previous jQuery.cleanData.
8630-
jQuery.cleanData = currentCleanData;
8661+
// Restore the previous cleanData.
8662+
jqLite.cleanData = currentCleanData;
86318663
});
8632-
});
8633-
}
8664+
}
8665+
});
86348666

86358667

86368668
it('should add a $$transcluded property onto the transcluded scope', function() {

test/ng/parseSpec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,8 @@ describe('parser', function() {
18671867
expect(scope.$eval('+\'1\'')).toEqual(+'1');
18681868
expect(scope.$eval('-\'1\'')).toEqual(-'1');
18691869
expect(scope.$eval('+undefined')).toEqual(0);
1870+
1871+
// Note: don't change toEqual to toBe as toBe collapses 0 & -0.
18701872
expect(scope.$eval('-undefined')).toEqual(-0);
18711873
expect(scope.$eval('+null')).toEqual(+null);
18721874
expect(scope.$eval('-null')).toEqual(-null);

0 commit comments

Comments
 (0)