Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 30ab202fa7 | |||
| 190bc1d52b | |||
| 4be80aefa2 | |||
| 837e519acc | |||
| ad7ea95386 | |||
| fd4a284c85 | |||
| 79ca0f1e91 | |||
| 848c9b51f1 | |||
| 16b0692885 | |||
| af3b71ef46 | |||
| dedb10c0b8 | |||
| 88a12f8623 | |||
| ebeb1c9491 | |||
| 864c7f00c4 | |||
| 2907798ca5 | |||
| 8562a62197 | |||
| fdfba097da | |||
| a07191727d | |||
| c133ef8360 | |||
| aa7d45e804 | |||
| 6b915ad9db | |||
| a42f8a0d5b | |||
| 6b0193e4d9 | |||
| e500fb6ddb | |||
| 204f9ffebe | |||
| 7eee0c2c13 | |||
| 2dc83b2f04 | |||
| 3154111bb4 | |||
| 2f6f1a7d70 | |||
| ff60b3f47a | |||
| c2d0783ca9 | |||
| 6706353a71 | |||
| 24eeab0ebd | |||
| b14f67f4ae | |||
| 411e35472b | |||
| af59a0a00b | |||
| 1c380b7671 | |||
| 84fb041a89 | |||
| aee7d53a6b | |||
| bfdc9170f2 | |||
| 494277e3d3 | |||
| e4339bc512 | |||
| 0e26197623 | |||
| 74726b4f79 | |||
| 3ad07eadef | |||
| 7920f7140f | |||
| 66fdf2a8a7 | |||
| 26a5779cdd | |||
| a90d0cbbba | |||
| 9307ccf6ee | |||
| 2c7aa68ca8 | |||
| 840b5f0a76 | |||
| 6c224a2a60 | |||
| af1e6a38b7 | |||
| 5b11145473 | |||
| d7d64cc363 | |||
| 998d8b4b55 | |||
| 2472d621d7 | |||
| 83f7980e2f | |||
| c9a92fcad5 | |||
| f7b2fffa51 | |||
| 9a065c0fa9 | |||
| 42e622b751 | |||
| ad0ba99d8a | |||
| 05170bf371 | |||
| db584f7835 | |||
| 83d1229c87 | |||
| 60069e67ae | |||
| 84d80be2b4 | |||
| 03a4782a35 | |||
| 0ed36430da | |||
| aa6adc77ae | |||
| a7de87d3e8 | |||
| 1bb9aa0523 | |||
| 586b6e8b73 | |||
| 459997b482 | |||
| 8e104ee508 | |||
| 78b9f61366 | |||
| b9f19ad0d4 | |||
| 0b1adbb2e7 | |||
| 6a1d7dd7dc | |||
| 5262039096 | |||
| 96c4cb6694 | |||
| 9fe596422f | |||
| e22c5d3dba |
@@ -1,27 +1,3 @@
|
||||
<a name="1.7.4"></a>
|
||||
# 1.7.4 interstellar-exploration (2018-09-07)
|
||||
|
||||
## Bug Fixes
|
||||
- **ngAria.ngClick:** prevent default event on space/enter only for non-interactive elements
|
||||
([61b335](https://github.com/angular/angular.js/commit/61b33543ff8e7f32464dec98a46bf0a35e9b03a4),
|
||||
[#16664](https://github.com/angular/angular.js/issues/16664),
|
||||
[#16680](https://github.com/angular/angular.js/issues/16680))
|
||||
- **ngAnimate:** remove the "prepare" classes with multiple structural animations
|
||||
([3105b2](https://github.com/angular/angular.js/commit/3105b2c26a71594c4e7904efc18f4b2e9da25b1b),
|
||||
[#16681](https://github.com/angular/angular.js/issues/16681),
|
||||
[#16677](https://github.com/angular/angular.js/issues/16677))
|
||||
- **$route:** correctly extract path params if the path contains a question mark or a hash
|
||||
([2ceeb7](https://github.com/angular/angular.js/commit/2ceeb739f35e01fcebcabac4beeeb7684ae9f86d))
|
||||
- **ngHref:** allow numbers and other objects in interpolation
|
||||
([30084c](https://github.com/angular/angular.js/commit/30084c13699c814ff6703d7aa2d3947a9b2f7067),
|
||||
[#16652](https://github.com/angular/angular.js/issues/16652),
|
||||
[#16626](https://github.com/angular/angular.js/issues/16626))
|
||||
- **select:** allow to select first option with value `undefined`
|
||||
([668a33](https://github.com/angular/angular.js/commit/668a33da3439f17e61dfa8f6d9b114ebde8c9d87),
|
||||
[#16653](https://github.com/angular/angular.js/issues/16653),
|
||||
[#16656](https://github.com/angular/angular.js/issues/16656))
|
||||
|
||||
|
||||
<a name="1.7.3"></a>
|
||||
# 1.7.3 eventful-proposal (2018-08-03)
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ For more information please visit {@link $http#json-vulnerability-protection JSO
|
||||
|
||||
Bear in mind that calling `$http.jsonp` gives the remote server (and, if the request is not secured, any Man-in-the-Middle attackers)
|
||||
instant remote code execution in your application: the result of these requests is handed off
|
||||
to the browser as a regular `<script>` tag.
|
||||
to the browser as regular `<script>` tag.
|
||||
|
||||
## Strict Contextual Escaping
|
||||
|
||||
|
||||
@@ -7,9 +7,26 @@
|
||||
This page describes the support status of the significant versions of AngularJS.
|
||||
|
||||
<div class="alert alert-info">
|
||||
On July 1, 2018 AngularJS entered a 3 year Long Term Support period.
|
||||
AngularJS is planning one more significant release, version 1.7, and on July 1, 2018 it will enter a 3 year Long Term Support period.
|
||||
</div>
|
||||
|
||||
### Until July 1st 2018
|
||||
|
||||
Any version branch not shown in the following table (e.g. 1.5.x) is no longer being developed.
|
||||
|
||||
<table class="dev-status table table-bordered">
|
||||
<thead>
|
||||
<tr><th>Version</th><th>Status</th><th>Comments</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="security"><td><span>1.2.x</span></td><td>Security patches only</td><td>Last version to provide IE 8 support</td></tr>
|
||||
<tr class="stable"><td><span>1.6.x</span></td><td>Patch Releases</td><td>Minor features, bug fixes, security patches - no breaking changes</td></tr>
|
||||
<tr class="current"><td><span>1.7.x</span></td><td>Active Development</td><td>1.7.0 (not yet released) will be the last release of AngularJS to contain breaking changes</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### After July 1st 2018
|
||||
|
||||
Any version branch not shown in the following table (e.g. 1.6.x) is no longer being developed.
|
||||
|
||||
<table class="dev-status table table-bordered">
|
||||
@@ -19,7 +36,7 @@ Any version branch not shown in the following table (e.g. 1.6.x) is no longer be
|
||||
<tbody>
|
||||
<tr class="security">
|
||||
<td><span>1.2.x</span></td>
|
||||
<td>Security patches only</td>
|
||||
<td>Long Term Support</td>
|
||||
<td>Last version to provide IE 8 support</td>
|
||||
</tr>
|
||||
<tr class="stable">
|
||||
@@ -32,16 +49,14 @@ Any version branch not shown in the following table (e.g. 1.6.x) is no longer be
|
||||
|
||||
### Long Term Support
|
||||
|
||||
On July 1st 2018, AngularJS entered a Long Term Support period for AngularJS.
|
||||
On July 1st 2018, we will enter a Long Term Support period for AngularJS.
|
||||
|
||||
We now focus exclusively on providing fixes to bugs that satisfy at least one of the following criteria:
|
||||
At this time we will focus exclusively on providing fixes to bugs that satisfy at least one of the following criteria:
|
||||
|
||||
* A security flaw is detected in the 1.7.x branch of the framework
|
||||
* One of the major browsers releases a version that will cause current production applications using AngularJS 1.7.x to stop working
|
||||
* The jQuery library releases a version that will cause current production applications using AngularJS 1.7.x to stop working.
|
||||
|
||||
AngularJS 1.2.x will get a new version if and only if a new severe security issue is discovered.
|
||||
|
||||
### Blog Post
|
||||
|
||||
You can read more about these plans in our [blog post announcement](https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c).
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
"license": "MIT",
|
||||
"branchVersion": "^1.7.0",
|
||||
"branchPattern": "1.7.*",
|
||||
"distTag": "latest",
|
||||
"distTag": "next",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/angular/angular.js.git"
|
||||
@@ -33,7 +33,7 @@
|
||||
"cross-spawn": "^4.0.0",
|
||||
"cz-conventional-changelog": "1.1.4",
|
||||
"dgeni": "^0.4.9",
|
||||
"dgeni-packages": "^0.26.5",
|
||||
"dgeni-packages": "^0.26.2",
|
||||
"eslint-plugin-promise": "^3.6.0",
|
||||
"event-stream": "~3.1.0",
|
||||
"glob": "^6.0.1",
|
||||
|
||||
@@ -10,7 +10,8 @@ const BROWSER_CACHE_DURATION = 60 * 10;
|
||||
const CDN_CACHE_DURATION = 60 * 60 * 12;
|
||||
|
||||
function sendStoredFile(request, response) {
|
||||
let filePathSegments = request.path.split('/').filter((segment) => {
|
||||
const requestPath = request.path || '/';
|
||||
let filePathSegments = requestPath.split('/').filter((segment) => {
|
||||
// Remove empty leading or trailing path parts
|
||||
return segment !== '';
|
||||
});
|
||||
@@ -159,7 +160,11 @@ function sendStoredFile(request, response) {
|
||||
const nextQuery = data[1];
|
||||
const apiResponse = data[2];
|
||||
|
||||
if (!files.length && (!apiResponse || !apiResponse.prefixes)) {
|
||||
if (
|
||||
// we got no files or directories from previous query pages
|
||||
!fileList.length && !directoryList.length &&
|
||||
// this query page has no file or directories
|
||||
!files.length && (!apiResponse || !apiResponse.prefixes)) {
|
||||
return Promise.reject({
|
||||
code: 404
|
||||
});
|
||||
@@ -190,22 +195,16 @@ const snapshotRegex = /^snapshot(-stable)?\//;
|
||||
* When a new zip file is uploaded into snapshot or snapshot-stable,
|
||||
* delete the previous zip file.
|
||||
*/
|
||||
function deleteOldSnapshotZip(event) {
|
||||
const object = event.data;
|
||||
|
||||
function deleteOldSnapshotZip(object, context) {
|
||||
const bucketId = object.bucket;
|
||||
const filePath = object.name;
|
||||
const contentType = object.contentType;
|
||||
const resourceState = object.resourceState;
|
||||
|
||||
const bucket = gcs.bucket(bucketId);
|
||||
|
||||
const snapshotFolderMatch = filePath.match(snapshotRegex);
|
||||
|
||||
if (!snapshotFolderMatch ||
|
||||
contentType !== 'application/zip' ||
|
||||
resourceState === 'not_exists' // Deletion event
|
||||
) {
|
||||
if (!snapshotFolderMatch || contentType !== 'application/zip') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,4 +229,4 @@ function deleteOldSnapshotZip(event) {
|
||||
}
|
||||
|
||||
exports.sendStoredFile = functions.https.onRequest(sendStoredFile);
|
||||
exports.deleteOldSnapshotZip = functions.storage.object().onChange(deleteOldSnapshotZip);
|
||||
exports.deleteOldSnapshotZip = functions.storage.object().onFinalize(deleteOldSnapshotZip);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
"description": "Cloud Functions to serve files from gcs to code.angularjs.org",
|
||||
"dependencies": {
|
||||
"@google-cloud/storage": "^1.1.1",
|
||||
"firebase-admin": "^4.2.1",
|
||||
"firebase-functions": "^0.5.9"
|
||||
"firebase-admin": "^5.11.0",
|
||||
"firebase-functions": "^1.0.4"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
||||
+4
-5
@@ -792,16 +792,15 @@ function arrayRemove(array, value) {
|
||||
* * If `source` is identical to `destination` an exception will be thrown.
|
||||
*
|
||||
* <br />
|
||||
*
|
||||
* <div class="alert alert-warning">
|
||||
* Only enumerable properties are taken into account. Non-enumerable properties (both on `source`
|
||||
* and on `destination`) will be ignored.
|
||||
* </div>
|
||||
*
|
||||
* @param {*} source The source that will be used to make a copy. Can be any type, including
|
||||
* primitives, `null`, and `undefined`.
|
||||
* @param {(Object|Array)=} destination Destination into which the source is copied. If provided,
|
||||
* must be of the same type as `source`.
|
||||
* @param {*} source The source that will be used to make a copy.
|
||||
* Can be any type, including primitives, `null`, and `undefined`.
|
||||
* @param {(Object|Array)=} destination Destination into which the source is copied. If
|
||||
* provided, must be of the same type as `source`.
|
||||
* @returns {*} The copy or updated `destination`, if `destination` was specified.
|
||||
*
|
||||
* @example
|
||||
|
||||
@@ -113,6 +113,8 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
|
||||
|
||||
// TODO(matsko): document the signature in a better way
|
||||
return function(element, event, options) {
|
||||
var node = getDomNode(element);
|
||||
|
||||
options = prepareAnimationOptions(options);
|
||||
var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;
|
||||
|
||||
@@ -184,9 +186,8 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
|
||||
forEach(groupedAnimations, function(animationEntry) {
|
||||
var element = animationEntry.from ? animationEntry.from.element : animationEntry.element;
|
||||
var extraClasses = options.addClass;
|
||||
|
||||
extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
|
||||
var cacheKey = $$animateCache.cacheKey(element[0], animationEntry.event, extraClasses, options.removeClass);
|
||||
var cacheKey = $$animateCache.cacheKey(node, event, extraClasses, options.removeClass);
|
||||
|
||||
toBeSortedAnimations.push({
|
||||
element: element,
|
||||
|
||||
Vendored
+85
-105
@@ -1771,8 +1771,8 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
||||
* See {@link ngMock.$httpBackend#when `when`} for more info.
|
||||
*/
|
||||
$httpBackend.whenRoute = function(method, url) {
|
||||
var parsed = parseRouteUrl(url);
|
||||
return $httpBackend.when(method, parsed.regexp, undefined, undefined, parsed.keys);
|
||||
var pathObj = routeToRegExp(url, {caseInsensitiveMatch: true, ignoreTrailingSlashes: true});
|
||||
return $httpBackend.when(method, pathObj.regexp, undefined, undefined, pathObj.keys);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1955,8 +1955,8 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
||||
* See {@link ngMock.$httpBackend#expect `expect`} for more info.
|
||||
*/
|
||||
$httpBackend.expectRoute = function(method, url) {
|
||||
var parsed = parseRouteUrl(url);
|
||||
return $httpBackend.expect(method, parsed.regexp, undefined, undefined, parsed.keys);
|
||||
var pathObj = routeToRegExp(url, {caseInsensitiveMatch: true, ignoreTrailingSlashes: true});
|
||||
return $httpBackend.expect(method, pathObj.regexp, undefined, undefined, pathObj.keys);
|
||||
};
|
||||
|
||||
|
||||
@@ -2084,12 +2084,6 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function parseRouteUrl(url) {
|
||||
var strippedUrl = stripQueryAndHash(url);
|
||||
var parseOptions = {caseInsensitiveMatch: true, ignoreTrailingSlashes: true};
|
||||
return routeToRegExp(strippedUrl, parseOptions);
|
||||
}
|
||||
}
|
||||
|
||||
function assertArgDefined(args, index, name) {
|
||||
@@ -2098,124 +2092,110 @@ function assertArgDefined(args, index, name) {
|
||||
}
|
||||
}
|
||||
|
||||
function stripQueryAndHash(url) {
|
||||
return url.replace(/[?#].*$/, '');
|
||||
}
|
||||
|
||||
function MockHttpExpectation(expectedMethod, expectedUrl, expectedData, expectedHeaders,
|
||||
expectedKeys) {
|
||||
function MockHttpExpectation(method, url, data, headers, keys) {
|
||||
|
||||
this.data = expectedData;
|
||||
this.headers = expectedHeaders;
|
||||
function getUrlParams(u) {
|
||||
var params = u.slice(u.indexOf('?') + 1).split('&');
|
||||
return params.sort();
|
||||
}
|
||||
|
||||
this.match = function(method, url, data, headers) {
|
||||
if (expectedMethod !== method) return false;
|
||||
if (!this.matchUrl(url)) return false;
|
||||
if (angular.isDefined(data) && !this.matchData(data)) return false;
|
||||
if (angular.isDefined(headers) && !this.matchHeaders(headers)) return false;
|
||||
function compareUrl(u) {
|
||||
return (url.slice(0, url.indexOf('?')) === u.slice(0, u.indexOf('?')) &&
|
||||
getUrlParams(url).join() === getUrlParams(u).join());
|
||||
}
|
||||
|
||||
this.data = data;
|
||||
this.headers = headers;
|
||||
|
||||
this.match = function(m, u, d, h) {
|
||||
if (method !== m) return false;
|
||||
if (!this.matchUrl(u)) return false;
|
||||
if (angular.isDefined(d) && !this.matchData(d)) return false;
|
||||
if (angular.isDefined(h) && !this.matchHeaders(h)) return false;
|
||||
return true;
|
||||
};
|
||||
|
||||
this.matchUrl = function(url) {
|
||||
if (!expectedUrl) return true;
|
||||
if (angular.isFunction(expectedUrl.test)) return expectedUrl.test(url);
|
||||
if (angular.isFunction(expectedUrl)) return expectedUrl(url);
|
||||
return (expectedUrl === url || compareUrlWithQuery(url));
|
||||
this.matchUrl = function(u) {
|
||||
if (!url) return true;
|
||||
if (angular.isFunction(url.test)) return url.test(u);
|
||||
if (angular.isFunction(url)) return url(u);
|
||||
return (url === u || compareUrl(u));
|
||||
};
|
||||
|
||||
this.matchHeaders = function(headers) {
|
||||
if (angular.isUndefined(expectedHeaders)) return true;
|
||||
if (angular.isFunction(expectedHeaders)) return expectedHeaders(headers);
|
||||
return angular.equals(expectedHeaders, headers);
|
||||
this.matchHeaders = function(h) {
|
||||
if (angular.isUndefined(headers)) return true;
|
||||
if (angular.isFunction(headers)) return headers(h);
|
||||
return angular.equals(headers, h);
|
||||
};
|
||||
|
||||
this.matchData = function(data) {
|
||||
if (angular.isUndefined(expectedData)) return true;
|
||||
if (expectedData && angular.isFunction(expectedData.test)) return expectedData.test(data);
|
||||
if (expectedData && angular.isFunction(expectedData)) return expectedData(data);
|
||||
if (expectedData && !angular.isString(expectedData)) {
|
||||
return angular.equals(angular.fromJson(angular.toJson(expectedData)), angular.fromJson(data));
|
||||
this.matchData = function(d) {
|
||||
if (angular.isUndefined(data)) return true;
|
||||
if (data && angular.isFunction(data.test)) return data.test(d);
|
||||
if (data && angular.isFunction(data)) return data(d);
|
||||
if (data && !angular.isString(data)) {
|
||||
return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));
|
||||
}
|
||||
// eslint-disable-next-line eqeqeq
|
||||
return expectedData == data;
|
||||
return data == d;
|
||||
};
|
||||
|
||||
this.toString = function() {
|
||||
return expectedMethod + ' ' + expectedUrl;
|
||||
return method + ' ' + url;
|
||||
};
|
||||
|
||||
this.params = function(url) {
|
||||
var queryStr = url.indexOf('?') === -1 ? '' : url.substring(url.indexOf('?') + 1);
|
||||
var strippedUrl = stripQueryAndHash(url);
|
||||
this.params = function(u) {
|
||||
return angular.extend(parseQuery(), pathParams());
|
||||
|
||||
return angular.extend(extractParamsFromQuery(queryStr), extractParamsFromPath(strippedUrl));
|
||||
};
|
||||
function pathParams() {
|
||||
var keyObj = {};
|
||||
if (!url || !angular.isFunction(url.test) || !keys || keys.length === 0) return keyObj;
|
||||
|
||||
function compareUrlWithQuery(url) {
|
||||
var urlWithQueryRe = /^([^?]*)\?(.*)$/;
|
||||
|
||||
var expectedMatch = urlWithQueryRe.exec(expectedUrl);
|
||||
var actualMatch = urlWithQueryRe.exec(url);
|
||||
|
||||
return !!(expectedMatch && actualMatch) &&
|
||||
(expectedMatch[1] === actualMatch[1]) &&
|
||||
(normalizeQuery(expectedMatch[2]) === normalizeQuery(actualMatch[2]));
|
||||
}
|
||||
|
||||
function normalizeQuery(queryStr) {
|
||||
return queryStr.split('&').sort().join('&');
|
||||
}
|
||||
|
||||
function extractParamsFromPath(strippedUrl) {
|
||||
var keyObj = {};
|
||||
|
||||
if (!expectedUrl || !angular.isFunction(expectedUrl.test) ||
|
||||
!expectedKeys || !expectedKeys.length) return keyObj;
|
||||
|
||||
var match = expectedUrl.exec(strippedUrl);
|
||||
if (!match) return keyObj;
|
||||
|
||||
for (var i = 1, len = match.length; i < len; ++i) {
|
||||
var key = expectedKeys[i - 1];
|
||||
var val = match[i];
|
||||
if (key && val) {
|
||||
keyObj[key.name || key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
return keyObj;
|
||||
}
|
||||
|
||||
function extractParamsFromQuery(queryStr) {
|
||||
var obj = {},
|
||||
keyValuePairs = queryStr.split('&').
|
||||
filter(angular.identity). // Ignore empty segments.
|
||||
map(function(keyValue) { return keyValue.replace(/\+/g, '%20').split('='); });
|
||||
|
||||
angular.forEach(keyValuePairs, function(pair) {
|
||||
var key = tryDecodeURIComponent(pair[0]);
|
||||
if (angular.isDefined(key)) {
|
||||
var val = angular.isDefined(pair[1]) ? tryDecodeURIComponent(pair[1]) : true;
|
||||
if (!hasOwnProperty.call(obj, key)) {
|
||||
obj[key] = val;
|
||||
} else if (angular.isArray(obj[key])) {
|
||||
obj[key].push(val);
|
||||
} else {
|
||||
obj[key] = [obj[key], val];
|
||||
var m = url.exec(u);
|
||||
if (!m) return keyObj;
|
||||
for (var i = 1, len = m.length; i < len; ++i) {
|
||||
var key = keys[i - 1];
|
||||
var val = m[i];
|
||||
if (key && val) {
|
||||
keyObj[key.name || key] = val;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function tryDecodeURIComponent(value) {
|
||||
try {
|
||||
return decodeURIComponent(value);
|
||||
} catch (e) {
|
||||
// Ignore any invalid uri component
|
||||
return keyObj;
|
||||
}
|
||||
}
|
||||
|
||||
function parseQuery() {
|
||||
var obj = {}, key_value, key,
|
||||
queryStr = u.indexOf('?') > -1
|
||||
? u.substring(u.indexOf('?') + 1)
|
||||
: '';
|
||||
|
||||
angular.forEach(queryStr.split('&'), function(keyValue) {
|
||||
if (keyValue) {
|
||||
key_value = keyValue.replace(/\+/g,'%20').split('=');
|
||||
key = tryDecodeURIComponent(key_value[0]);
|
||||
if (angular.isDefined(key)) {
|
||||
var val = angular.isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true;
|
||||
if (!hasOwnProperty.call(obj, key)) {
|
||||
obj[key] = val;
|
||||
} else if (angular.isArray(obj[key])) {
|
||||
obj[key].push(val);
|
||||
} else {
|
||||
obj[key] = [obj[key],val];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
function tryDecodeURIComponent(value) {
|
||||
try {
|
||||
return decodeURIComponent(value);
|
||||
} catch (e) {
|
||||
// Ignore any invalid uri component
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function createMockXhr() {
|
||||
|
||||
@@ -225,7 +225,6 @@ function $RouteProvider() {
|
||||
}
|
||||
routes[path] = angular.extend(
|
||||
routeCopy,
|
||||
{originalPath: path},
|
||||
path && routeToRegExp(path, routeCopy)
|
||||
);
|
||||
|
||||
@@ -236,7 +235,7 @@ function $RouteProvider() {
|
||||
: path + '/';
|
||||
|
||||
routes[redirectPath] = angular.extend(
|
||||
{originalPath: path, redirectTo: path},
|
||||
{redirectTo: path},
|
||||
routeToRegExp(redirectPath, routeCopy)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,16 +3,15 @@
|
||||
/* global routeToRegExp: true */
|
||||
|
||||
/**
|
||||
* @param {string} path - The path to parse. (It is assumed to have query and hash stripped off.)
|
||||
* @param {Object} opts - Options.
|
||||
* @return {Object} - An object containing an array of path parameter names (`keys`) and a regular
|
||||
* expression (`regexp`) that can be used to identify a matching URL and extract the path
|
||||
* parameter values.
|
||||
* @param path {string} path
|
||||
* @param opts {Object} options
|
||||
* @return {?Object}
|
||||
*
|
||||
* @description
|
||||
* Parses the given path, extracting path parameter names and a regular expression to match URLs.
|
||||
* Normalizes the given path, returning a regular expression
|
||||
* and the original path.
|
||||
*
|
||||
* Originally inspired by `pathRexp` in `visionmedia/express/lib/utils.js`.
|
||||
* Inspired by pathRexp in visionmedia/express/lib/utils.js.
|
||||
*/
|
||||
function routeToRegExp(path, opts) {
|
||||
var keys = [];
|
||||
@@ -22,11 +21,11 @@ function routeToRegExp(path, opts) {
|
||||
.replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) {
|
||||
var optional = option === '?' || option === '*?';
|
||||
var star = option === '*' || option === '*?';
|
||||
keys.push({name: key, optional: optional});
|
||||
keys.push({ name: key, optional: optional });
|
||||
slash = slash || '';
|
||||
return (
|
||||
(optional ? '(?:' + slash : slash + '(?:') +
|
||||
(star ? '(.+?)' : '([^/]+)') +
|
||||
(star ? '([^?#]+?)' : '([^/?#]+)') +
|
||||
(optional ? '?)?' : ')')
|
||||
);
|
||||
})
|
||||
@@ -37,6 +36,7 @@ function routeToRegExp(path, opts) {
|
||||
}
|
||||
|
||||
return {
|
||||
originalPath: path,
|
||||
keys: keys,
|
||||
regexp: new RegExp(
|
||||
'^' + pattern + '(?:[?#]|$)',
|
||||
|
||||
@@ -25,7 +25,6 @@ describe('ngAnimate integration tests', function() {
|
||||
ss.destroy();
|
||||
});
|
||||
|
||||
|
||||
it('should cancel a running and started removeClass animation when a follow-up addClass animation adds the same class',
|
||||
inject(function($animate, $rootScope, $$rAF, $document, $rootElement) {
|
||||
|
||||
@@ -363,7 +362,6 @@ describe('ngAnimate integration tests', function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('should add the preparation class for an enter animation before a parent class-based animation is applied', function() {
|
||||
module('ngAnimateMock');
|
||||
inject(function($animate, $compile, $rootScope, $rootElement, $document) {
|
||||
@@ -399,7 +397,6 @@ describe('ngAnimate integration tests', function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('should avoid adding the ng-enter-prepare method to a parent structural animation that contains child animations', function() {
|
||||
module('ngAnimateMock');
|
||||
inject(function($animate, $compile, $rootScope, $rootElement, $document, $$rAF) {
|
||||
@@ -471,84 +468,6 @@ describe('ngAnimate integration tests', function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('should remove the prepare classes when different structural animations happen in the same digest', function() {
|
||||
module('ngAnimateMock');
|
||||
inject(function($animate, $compile, $rootScope, $rootElement, $document, $$animateCache) {
|
||||
element = jqLite(
|
||||
// Class animation on parent element is neeeded so the child elements get the prepare class
|
||||
'<div id="outer" ng-class="{blue: cond}" ng-switch="cond">' +
|
||||
'<div id="default" ng-switch-default></div>' +
|
||||
'<div id="truthy" ng-switch-when="true"></div>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
$rootElement.append(element);
|
||||
jqLite($document[0].body).append($rootElement);
|
||||
|
||||
$compile(element)($rootScope);
|
||||
$rootScope.cond = false;
|
||||
$rootScope.$digest();
|
||||
|
||||
$rootScope.cond = true;
|
||||
$rootScope.$digest();
|
||||
|
||||
var parent = element;
|
||||
var truthySwitch = jqLite(parent[0].querySelector('#truthy'));
|
||||
var defaultSwitch = jqLite(parent[0].querySelector('#default'));
|
||||
|
||||
expect(parent).not.toHaveClass('blue');
|
||||
expect(parent).toHaveClass('blue-add');
|
||||
expect(truthySwitch).toHaveClass('ng-enter-prepare');
|
||||
expect(defaultSwitch).toHaveClass('ng-leave-prepare');
|
||||
|
||||
$animate.flush();
|
||||
|
||||
expect(parent).toHaveClass('blue');
|
||||
expect(parent).not.toHaveClass('blue-add');
|
||||
expect(truthySwitch).not.toHaveClass('ng-enter-prepare');
|
||||
expect(defaultSwitch).not.toHaveClass('ng-leave-prepare');
|
||||
});
|
||||
});
|
||||
|
||||
it('should respect the element node for caching when animations with the same type happen in the same digest', function() {
|
||||
module('ngAnimateMock');
|
||||
inject(function($animate, $compile, $rootScope, $rootElement, $document, $$animateCache) {
|
||||
ss.addRule('.animate.ng-enter', 'transition:2s linear all;');
|
||||
|
||||
element = jqLite(
|
||||
'<div>' +
|
||||
'<div>' +
|
||||
'<div id="noanimate" ng-if="cond"></div>' +
|
||||
'</div>' +
|
||||
'<div>' +
|
||||
'<div id="animate" class="animate" ng-if="cond"></div>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
$rootElement.append(element);
|
||||
jqLite($document[0].body).append($rootElement);
|
||||
|
||||
$compile(element)($rootScope);
|
||||
$rootScope.cond = true;
|
||||
$rootScope.$digest();
|
||||
|
||||
var parent = element;
|
||||
var noanimate = jqLite(parent[0].querySelector('#noanimate'));
|
||||
var animate = jqLite(parent[0].querySelector('#animate'));
|
||||
|
||||
expect(noanimate).not.toHaveClass('ng-enter');
|
||||
expect(animate).toHaveClass('ng-enter');
|
||||
|
||||
$animate.closeAndFlush();
|
||||
|
||||
expect(noanimate).not.toHaveClass('ng-enter');
|
||||
expect(animate).not.toHaveClass('ng-enter');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('should pack level elements into their own RAF flush', function() {
|
||||
module('ngAnimateMock');
|
||||
inject(function($animate, $compile, $rootScope, $rootElement, $document) {
|
||||
|
||||
Vendored
+3
-3
@@ -2251,7 +2251,7 @@ describe('ngMock', function() {
|
||||
}
|
||||
);
|
||||
they('should ignore query params when matching in ' + routeShortcut + ' $prop method', methods,
|
||||
function(method) {
|
||||
function() {
|
||||
angular.forEach([
|
||||
{route: '/route1/:id', url: '/route1/Alpha', expectedParams: {id: 'Alpha'}},
|
||||
{route: '/route2/:id', url: '/route2/Bravo/?', expectedParams: {id: 'Bravo'}},
|
||||
@@ -2268,14 +2268,14 @@ describe('ngMock', function() {
|
||||
], function(testDataEntry) {
|
||||
callback.calls.reset();
|
||||
var paramsSpy = jasmine.createSpy('params');
|
||||
hb[routeShortcut](method, testDataEntry.route).respond(
|
||||
hb[routeShortcut](this, testDataEntry.route).respond(
|
||||
function(method, url, data, headers, params) {
|
||||
paramsSpy(params);
|
||||
// status, response, headers, statusText, xhrStatus
|
||||
return [200, 'path', { 'x-header': 'foo' }, 'OK', 'complete'];
|
||||
}
|
||||
);
|
||||
hb(method, testDataEntry.url, undefined, callback);
|
||||
hb(this, testDataEntry.url, undefined, callback);
|
||||
hb.flush();
|
||||
expect(callback).toHaveBeenCalledOnceWith(200, 'path', 'x-header: foo', 'OK', 'complete');
|
||||
expect(paramsSpy).toHaveBeenCalledOnceWith(testDataEntry.expectedParams);
|
||||
|
||||
@@ -77,45 +77,5 @@ describe('$routeParams', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should correctly extract path params containing hashes and/or question marks', function() {
|
||||
module(function($routeProvider) {
|
||||
$routeProvider.when('/foo/:bar', {});
|
||||
$routeProvider.when('/zoo/:bar/:baz/:qux', {});
|
||||
});
|
||||
|
||||
inject(function($location, $rootScope, $routeParams) {
|
||||
$location.path('/foo/bar?baz');
|
||||
$rootScope.$digest();
|
||||
expect($routeParams).toEqual({bar: 'bar?baz'});
|
||||
|
||||
$location.path('/foo/bar?baz=val');
|
||||
$rootScope.$digest();
|
||||
expect($routeParams).toEqual({bar: 'bar?baz=val'});
|
||||
|
||||
$location.path('/foo/bar#baz');
|
||||
$rootScope.$digest();
|
||||
expect($routeParams).toEqual({bar: 'bar#baz'});
|
||||
|
||||
$location.path('/foo/bar?baz#qux');
|
||||
$rootScope.$digest();
|
||||
expect($routeParams).toEqual({bar: 'bar?baz#qux'});
|
||||
|
||||
$location.path('/foo/bar?baz=val#qux');
|
||||
$rootScope.$digest();
|
||||
expect($routeParams).toEqual({bar: 'bar?baz=val#qux'});
|
||||
|
||||
$location.path('/foo/bar#baz?qux');
|
||||
$rootScope.$digest();
|
||||
expect($routeParams).toEqual({bar: 'bar#baz?qux'});
|
||||
|
||||
$location.path('/zoo/bar?p1=v1#h1/baz?p2=v2#h2/qux?p3=v3#h3');
|
||||
$rootScope.$digest();
|
||||
expect($routeParams).toEqual({
|
||||
bar: 'bar?p1=v1#h1',
|
||||
baz: 'baz?p2=v2#h2',
|
||||
qux: 'qux?p3=v3#h3'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1727,9 +1727,9 @@ detective@^4.0.0:
|
||||
acorn "^3.1.0"
|
||||
defined "^1.0.0"
|
||||
|
||||
dgeni-packages@^0.26.5:
|
||||
version "0.26.5"
|
||||
resolved "https://registry.yarnpkg.com/dgeni-packages/-/dgeni-packages-0.26.5.tgz#a76da27b40ce92dfc37a9e629ef9f1d3897f6bde"
|
||||
dgeni-packages@^0.26.2:
|
||||
version "0.26.2"
|
||||
resolved "https://registry.yarnpkg.com/dgeni-packages/-/dgeni-packages-0.26.2.tgz#dac22d7e861d4d72ed42af5272714f42b6b5bf3d"
|
||||
dependencies:
|
||||
canonical-path "0.0.2"
|
||||
catharsis "^0.8.1"
|
||||
|
||||
Reference in New Issue
Block a user