angularjs-rails 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/angularjs-rails/version.rb +1 -1
- data/vendor/assets/javascripts/angular-animate.js +85 -89
- data/vendor/assets/javascripts/angular-aria.js +3 -3
- data/vendor/assets/javascripts/angular-cookies.js +2 -2
- data/vendor/assets/javascripts/angular-loader.js +3 -3
- data/vendor/assets/javascripts/angular-message-format.js +2 -2
- data/vendor/assets/javascripts/angular-messages.js +2 -2
- data/vendor/assets/javascripts/angular-mocks.js +37 -22
- data/vendor/assets/javascripts/angular-parse-ext.js +2 -2
- data/vendor/assets/javascripts/angular-resource.js +18 -16
- data/vendor/assets/javascripts/angular-route.js +15 -3
- data/vendor/assets/javascripts/angular-sanitize.js +2 -2
- data/vendor/assets/javascripts/angular-scenario.js +426 -274
- data/vendor/assets/javascripts/angular-touch.js +2 -2
- data/vendor/assets/javascripts/angular.js +425 -273
- metadata +2 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.6.
|
3
|
-
* (c) 2010-
|
2
|
+
* @license AngularJS v1.6.2
|
3
|
+
* (c) 2010-2017 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
(function(window, angular) {'use strict';
|
@@ -360,7 +360,7 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
|
|
360
360
|
return {
|
361
361
|
restrict: 'A',
|
362
362
|
compile: function(elem, attr) {
|
363
|
-
var fn = $parse(attr.ngClick
|
363
|
+
var fn = $parse(attr.ngClick);
|
364
364
|
return function(scope, elem, attr) {
|
365
365
|
|
366
366
|
if (!isNodeOneOf(elem, nodeBlackList)) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.6.
|
3
|
-
* (c) 2010-
|
2
|
+
* @license AngularJS v1.6.2
|
3
|
+
* (c) 2010-2017 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
|
@@ -87,7 +87,7 @@ function minErr(module, ErrorConstructor) {
|
|
87
87
|
return match;
|
88
88
|
});
|
89
89
|
|
90
|
-
message += '\nhttp://errors.angularjs.org/1.6.
|
90
|
+
message += '\nhttp://errors.angularjs.org/1.6.2/' +
|
91
91
|
(module ? module + '/' : '') + code;
|
92
92
|
|
93
93
|
for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.6.
|
3
|
-
* (c) 2010-
|
2
|
+
* @license AngularJS v1.6.2
|
3
|
+
* (c) 2010-2017 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
(function(window, angular) {
|
@@ -44,10 +44,30 @@ angular.mock.$Browser = function() {
|
|
44
44
|
self.$$lastUrl = self.$$url; // used by url polling fn
|
45
45
|
self.pollFns = [];
|
46
46
|
|
47
|
-
//
|
48
|
-
self.$$completeOutstandingRequest = angular.noop;
|
49
|
-
self.$$incOutstandingRequestCount = angular.noop;
|
47
|
+
// Testability API
|
50
48
|
|
49
|
+
var outstandingRequestCount = 0;
|
50
|
+
var outstandingRequestCallbacks = [];
|
51
|
+
self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
|
52
|
+
self.$$completeOutstandingRequest = function(fn) {
|
53
|
+
try {
|
54
|
+
fn();
|
55
|
+
} finally {
|
56
|
+
outstandingRequestCount--;
|
57
|
+
if (!outstandingRequestCount) {
|
58
|
+
while (outstandingRequestCallbacks.length) {
|
59
|
+
outstandingRequestCallbacks.pop()();
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
};
|
64
|
+
self.notifyWhenNoOutstandingRequests = function(callback) {
|
65
|
+
if (outstandingRequestCount) {
|
66
|
+
outstandingRequestCallbacks.push(callback);
|
67
|
+
} else {
|
68
|
+
callback();
|
69
|
+
}
|
70
|
+
};
|
51
71
|
|
52
72
|
// register url polling fn
|
53
73
|
|
@@ -72,6 +92,8 @@ angular.mock.$Browser = function() {
|
|
72
92
|
self.deferredNextId = 0;
|
73
93
|
|
74
94
|
self.defer = function(fn, delay) {
|
95
|
+
// Note that we do not use `$$incOutstandingRequestCount` or `$$completeOutstandingRequest`
|
96
|
+
// in this mock implementation.
|
75
97
|
delay = delay || 0;
|
76
98
|
self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});
|
77
99
|
self.deferredFns.sort(function(a, b) { return a.time - b.time;});
|
@@ -173,10 +195,6 @@ angular.mock.$Browser.prototype = {
|
|
173
195
|
|
174
196
|
state: function() {
|
175
197
|
return this.$$state;
|
176
|
-
},
|
177
|
-
|
178
|
-
notifyWhenNoOutstandingRequests: function(fn) {
|
179
|
-
fn();
|
180
198
|
}
|
181
199
|
};
|
182
200
|
|
@@ -1302,9 +1320,8 @@ angular.mock.dump = function(object) {
|
|
1302
1320
|
});
|
1303
1321
|
```
|
1304
1322
|
*/
|
1305
|
-
angular.mock.$
|
1306
|
-
|
1307
|
-
};
|
1323
|
+
angular.mock.$httpBackendDecorator =
|
1324
|
+
['$rootScope', '$timeout', '$delegate', createHttpBackendMock];
|
1308
1325
|
|
1309
1326
|
/**
|
1310
1327
|
* General factory function for $httpBackend mock.
|
@@ -1325,7 +1342,10 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1325
1342
|
expectations = [],
|
1326
1343
|
responses = [],
|
1327
1344
|
responsesPush = angular.bind(responses, responses.push),
|
1328
|
-
copy = angular.copy
|
1345
|
+
copy = angular.copy,
|
1346
|
+
// We cache the original backend so that if both ngMock and ngMockE2E override the
|
1347
|
+
// service the ngMockE2E version can pass through to the real backend
|
1348
|
+
originalHttpBackend = $delegate.$$originalHttpBackend || $delegate;
|
1329
1349
|
|
1330
1350
|
function createResponse(status, data, headers, statusText) {
|
1331
1351
|
if (angular.isFunction(status)) return status;
|
@@ -1410,7 +1430,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1410
1430
|
// if $browser specified, we do auto flush all requests
|
1411
1431
|
($browser ? $browser.defer : responsesPush)(wrapResponse(definition));
|
1412
1432
|
} else if (definition.passThrough) {
|
1413
|
-
|
1433
|
+
originalHttpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers);
|
1414
1434
|
} else throw new Error('No response defined !');
|
1415
1435
|
return;
|
1416
1436
|
}
|
@@ -1886,6 +1906,8 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
|
|
1886
1906
|
responses.length = 0;
|
1887
1907
|
};
|
1888
1908
|
|
1909
|
+
$httpBackend.$$originalHttpBackend = originalHttpBackend;
|
1910
|
+
|
1889
1911
|
return $httpBackend;
|
1890
1912
|
|
1891
1913
|
|
@@ -2383,7 +2405,6 @@ angular.module('ngMock', ['ng']).provider({
|
|
2383
2405
|
$exceptionHandler: angular.mock.$ExceptionHandlerProvider,
|
2384
2406
|
$log: angular.mock.$LogProvider,
|
2385
2407
|
$interval: angular.mock.$IntervalProvider,
|
2386
|
-
$httpBackend: angular.mock.$HttpBackendProvider,
|
2387
2408
|
$rootElement: angular.mock.$RootElementProvider,
|
2388
2409
|
$componentController: angular.mock.$ComponentControllerProvider
|
2389
2410
|
}).config(['$provide', '$compileProvider', function($provide, $compileProvider) {
|
@@ -2391,6 +2412,7 @@ angular.module('ngMock', ['ng']).provider({
|
|
2391
2412
|
$provide.decorator('$$rAF', angular.mock.$RAFDecorator);
|
2392
2413
|
$provide.decorator('$rootScope', angular.mock.$RootScopeDecorator);
|
2393
2414
|
$provide.decorator('$controller', createControllerDecorator($compileProvider));
|
2415
|
+
$provide.decorator('$httpBackend', angular.mock.$httpBackendDecorator);
|
2394
2416
|
}]);
|
2395
2417
|
|
2396
2418
|
/**
|
@@ -2405,7 +2427,6 @@ angular.module('ngMock', ['ng']).provider({
|
|
2405
2427
|
* the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.
|
2406
2428
|
*/
|
2407
2429
|
angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
|
2408
|
-
$provide.value('$httpBackend', angular.injector(['ng']).get('$httpBackend'));
|
2409
2430
|
$provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
|
2410
2431
|
}]);
|
2411
2432
|
|
@@ -2971,12 +2992,6 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
|
|
2971
2992
|
delete fn.$inject;
|
2972
2993
|
});
|
2973
2994
|
|
2974
|
-
angular.forEach(currentSpec.$modules, function(module) {
|
2975
|
-
if (module && module.$$hashKey) {
|
2976
|
-
module.$$hashKey = undefined;
|
2977
|
-
}
|
2978
|
-
});
|
2979
|
-
|
2980
2995
|
currentSpec.$injector = null;
|
2981
2996
|
currentSpec.$modules = null;
|
2982
2997
|
currentSpec.$providerInjector = null;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.6.
|
3
|
-
* (c) 2010-
|
2
|
+
* @license AngularJS v1.6.2
|
3
|
+
* (c) 2010-2017 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
(function(window, angular) {'use strict';
|
@@ -595,11 +595,12 @@ angular.module('ngResource', ['ng']).
|
|
595
595
|
url = url.replace(/\/+$/, '') || '/';
|
596
596
|
}
|
597
597
|
|
598
|
-
//
|
599
|
-
// E.g. `http://url.com/id
|
598
|
+
// Collapse `/.` if found in the last URL path segment before the query.
|
599
|
+
// E.g. `http://url.com/id/.format?q=x` becomes `http://url.com/id.format?q=x`.
|
600
600
|
url = url.replace(/\/\.(?=\w+($|\?))/, '.');
|
601
|
-
//
|
602
|
-
|
601
|
+
// Replace escaped `/\.` with `/.`.
|
602
|
+
// (If `\.` comes from a param value, it will be encoded as `%5C.`.)
|
603
|
+
config.url = protocolAndIpv6 + url.replace(/\/(\\|%5C)\./, '/.');
|
603
604
|
|
604
605
|
|
605
606
|
// set params - delegate param encoding to $http
|
@@ -641,6 +642,7 @@ angular.module('ngResource', ['ng']).
|
|
641
642
|
var data = extend({}, this);
|
642
643
|
delete data.$promise;
|
643
644
|
delete data.$resolved;
|
645
|
+
delete data.$cancelRequest;
|
644
646
|
return data;
|
645
647
|
};
|
646
648
|
|
@@ -788,18 +790,18 @@ angular.module('ngResource', ['ng']).
|
|
788
790
|
return value;
|
789
791
|
},
|
790
792
|
(hasError || hasResponseErrorInterceptor) ?
|
791
|
-
|
792
|
-
|
793
|
-
|
793
|
+
function(response) {
|
794
|
+
if (hasError && !hasResponseErrorInterceptor) {
|
795
|
+
// Avoid `Possibly Unhandled Rejection` error,
|
796
|
+
// but still fulfill the returned promise with a rejection
|
797
|
+
promise.catch(noop);
|
798
|
+
}
|
799
|
+
if (hasError) error(response);
|
800
|
+
return hasResponseErrorInterceptor ?
|
794
801
|
responseErrorInterceptor(response) :
|
795
802
|
$q.reject(response);
|
796
|
-
|
797
|
-
|
798
|
-
if (hasError && !hasResponseErrorInterceptor) {
|
799
|
-
// Avoid `Possibly Unhandled Rejection` error,
|
800
|
-
// but still fulfill the returned promise with a rejection
|
801
|
-
promise.catch(noop);
|
802
|
-
}
|
803
|
+
} :
|
804
|
+
undefined);
|
803
805
|
|
804
806
|
if (!isInstanceCall) {
|
805
807
|
// we are creating instance / collection
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.6.
|
3
|
-
* (c) 2010-
|
2
|
+
* @license AngularJS v1.6.2
|
3
|
+
* (c) 2010-2017 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
(function(window, angular) {'use strict';
|
@@ -39,6 +39,7 @@ function shallowCopy(src, dst) {
|
|
39
39
|
var isArray;
|
40
40
|
var isObject;
|
41
41
|
var isDefined;
|
42
|
+
var noop;
|
42
43
|
|
43
44
|
/**
|
44
45
|
* @ngdoc module
|
@@ -86,6 +87,7 @@ function $RouteProvider() {
|
|
86
87
|
isArray = angular.isArray;
|
87
88
|
isObject = angular.isObject;
|
88
89
|
isDefined = angular.isDefined;
|
90
|
+
noop = angular.noop;
|
89
91
|
|
90
92
|
function inherit(parent, extra) {
|
91
93
|
return angular.extend(Object.create(parent), extra);
|
@@ -382,7 +384,8 @@ function $RouteProvider() {
|
|
382
384
|
'$injector',
|
383
385
|
'$templateRequest',
|
384
386
|
'$sce',
|
385
|
-
|
387
|
+
'$browser',
|
388
|
+
function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) {
|
386
389
|
|
387
390
|
/**
|
388
391
|
* @ngdoc service
|
@@ -712,6 +715,8 @@ function $RouteProvider() {
|
|
712
715
|
|
713
716
|
var nextRoutePromise = $q.resolve(nextRoute);
|
714
717
|
|
718
|
+
$browser.$$incOutstandingRequestCount();
|
719
|
+
|
715
720
|
nextRoutePromise.
|
716
721
|
then(getRedirectionData).
|
717
722
|
then(handlePossibleRedirection).
|
@@ -732,6 +737,13 @@ function $RouteProvider() {
|
|
732
737
|
if (nextRoute === $route.current) {
|
733
738
|
$rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
|
734
739
|
}
|
740
|
+
}).finally(function() {
|
741
|
+
// Because `commitRoute()` is called from a `$rootScope.$evalAsync` block (see
|
742
|
+
// `$locationWatch`), this `$$completeOutstandingRequest()` call will not cause
|
743
|
+
// `outstandingRequestCount` to hit zero. This is important in case we are redirecting
|
744
|
+
// to a new route which also requires some asynchronous work.
|
745
|
+
|
746
|
+
$browser.$$completeOutstandingRequest(noop);
|
735
747
|
});
|
736
748
|
}
|
737
749
|
}
|
@@ -10071,8 +10071,8 @@ return jQuery;
|
|
10071
10071
|
} );
|
10072
10072
|
|
10073
10073
|
/**
|
10074
|
-
* @license AngularJS v1.6.
|
10075
|
-
* (c) 2010-
|
10074
|
+
* @license AngularJS v1.6.2
|
10075
|
+
* (c) 2010-2017 Google, Inc. http://angularjs.org
|
10076
10076
|
* License: MIT
|
10077
10077
|
*/
|
10078
10078
|
(function(window){
|
@@ -10130,7 +10130,7 @@ function minErr(module, ErrorConstructor) {
|
|
10130
10130
|
return match;
|
10131
10131
|
});
|
10132
10132
|
|
10133
|
-
message += '\nhttp://errors.angularjs.org/1.6.
|
10133
|
+
message += '\nhttp://errors.angularjs.org/1.6.2/' +
|
10134
10134
|
(module ? module + '/' : '') + code;
|
10135
10135
|
|
10136
10136
|
for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
|
@@ -11621,12 +11621,16 @@ function getNgAttribute(element, ngAttr) {
|
|
11621
11621
|
}
|
11622
11622
|
|
11623
11623
|
function allowAutoBootstrap(document) {
|
11624
|
-
|
11624
|
+
var script = document.currentScript;
|
11625
|
+
var src = script && script.getAttribute('src');
|
11626
|
+
|
11627
|
+
if (!src) {
|
11625
11628
|
return true;
|
11626
11629
|
}
|
11627
|
-
|
11630
|
+
|
11628
11631
|
var link = document.createElement('a');
|
11629
11632
|
link.href = src;
|
11633
|
+
|
11630
11634
|
if (document.location.origin === link.origin) {
|
11631
11635
|
// Same-origin resources are always allowed, even for non-whitelisted schemes.
|
11632
11636
|
return true;
|
@@ -12008,7 +12012,7 @@ function bindJQuery() {
|
|
12008
12012
|
extend(jQuery.fn, {
|
12009
12013
|
scope: JQLitePrototype.scope,
|
12010
12014
|
isolateScope: JQLitePrototype.isolateScope,
|
12011
|
-
controller: JQLitePrototype.controller,
|
12015
|
+
controller: /** @type {?} */ (JQLitePrototype).controller,
|
12012
12016
|
injector: JQLitePrototype.injector,
|
12013
12017
|
inheritedData: JQLitePrototype.inheritedData
|
12014
12018
|
});
|
@@ -12650,7 +12654,6 @@ function toDebugString(obj) {
|
|
12650
12654
|
$$ForceReflowProvider,
|
12651
12655
|
$InterpolateProvider,
|
12652
12656
|
$IntervalProvider,
|
12653
|
-
$$HashMapProvider,
|
12654
12657
|
$HttpProvider,
|
12655
12658
|
$HttpParamSerializerProvider,
|
12656
12659
|
$HttpParamSerializerJQLikeProvider,
|
@@ -12659,6 +12662,7 @@ function toDebugString(obj) {
|
|
12659
12662
|
$jsonpCallbacksProvider,
|
12660
12663
|
$LocationProvider,
|
12661
12664
|
$LogProvider,
|
12665
|
+
$$MapProvider,
|
12662
12666
|
$ParseProvider,
|
12663
12667
|
$RootScopeProvider,
|
12664
12668
|
$QProvider,
|
@@ -12696,11 +12700,11 @@ function toDebugString(obj) {
|
|
12696
12700
|
var version = {
|
12697
12701
|
// These placeholder strings will be replaced by grunt's `build` task.
|
12698
12702
|
// They need to be double- or single-quoted.
|
12699
|
-
full: '1.6.
|
12703
|
+
full: '1.6.2',
|
12700
12704
|
major: 1,
|
12701
12705
|
minor: 6,
|
12702
|
-
dot:
|
12703
|
-
codeName: '
|
12706
|
+
dot: 2,
|
12707
|
+
codeName: 'llamacorn-lovehug'
|
12704
12708
|
};
|
12705
12709
|
|
12706
12710
|
|
@@ -12840,7 +12844,7 @@ function publishExternalAPI(angular) {
|
|
12840
12844
|
$window: $WindowProvider,
|
12841
12845
|
$$rAF: $$RAFProvider,
|
12842
12846
|
$$jqLite: $$jqLiteProvider,
|
12843
|
-
$$
|
12847
|
+
$$Map: $$MapProvider,
|
12844
12848
|
$$cookieReader: $$CookieReaderProvider
|
12845
12849
|
});
|
12846
12850
|
}
|
@@ -13988,50 +13992,70 @@ function hashKey(obj, nextUidFn) {
|
|
13988
13992
|
return key;
|
13989
13993
|
}
|
13990
13994
|
|
13991
|
-
|
13992
|
-
|
13993
|
-
|
13994
|
-
|
13995
|
-
|
13996
|
-
|
13997
|
-
|
13998
|
-
|
13999
|
-
|
14000
|
-
|
14001
|
-
|
14002
|
-
|
14003
|
-
|
14004
|
-
|
14005
|
-
|
14006
|
-
|
14007
|
-
|
14008
|
-
|
14009
|
-
|
14010
|
-
|
13995
|
+
// A minimal ES2015 Map implementation.
|
13996
|
+
// Should be bug/feature equivalent to the native implementations of supported browsers
|
13997
|
+
// (for the features required in Angular).
|
13998
|
+
// See https://kangax.github.io/compat-table/es6/#test-Map
|
13999
|
+
var nanKey = Object.create(null);
|
14000
|
+
function NgMapShim() {
|
14001
|
+
this._keys = [];
|
14002
|
+
this._values = [];
|
14003
|
+
this._lastKey = NaN;
|
14004
|
+
this._lastIndex = -1;
|
14005
|
+
}
|
14006
|
+
NgMapShim.prototype = {
|
14007
|
+
_idx: function(key) {
|
14008
|
+
if (key === this._lastKey) {
|
14009
|
+
return this._lastIndex;
|
14010
|
+
}
|
14011
|
+
this._lastKey = key;
|
14012
|
+
this._lastIndex = this._keys.indexOf(key);
|
14013
|
+
return this._lastIndex;
|
14014
|
+
},
|
14015
|
+
_transformKey: function(key) {
|
14016
|
+
return isNumberNaN(key) ? nanKey : key;
|
14011
14017
|
},
|
14012
|
-
|
14013
|
-
/**
|
14014
|
-
* @param key
|
14015
|
-
* @returns {Object} the value for the key
|
14016
|
-
*/
|
14017
14018
|
get: function(key) {
|
14018
|
-
|
14019
|
+
key = this._transformKey(key);
|
14020
|
+
var idx = this._idx(key);
|
14021
|
+
if (idx !== -1) {
|
14022
|
+
return this._values[idx];
|
14023
|
+
}
|
14019
14024
|
},
|
14025
|
+
set: function(key, value) {
|
14026
|
+
key = this._transformKey(key);
|
14027
|
+
var idx = this._idx(key);
|
14028
|
+
if (idx === -1) {
|
14029
|
+
idx = this._lastIndex = this._keys.length;
|
14030
|
+
}
|
14031
|
+
this._keys[idx] = key;
|
14032
|
+
this._values[idx] = value;
|
14020
14033
|
|
14021
|
-
|
14022
|
-
|
14023
|
-
|
14024
|
-
|
14025
|
-
|
14026
|
-
var
|
14027
|
-
|
14028
|
-
|
14034
|
+
// Support: IE11
|
14035
|
+
// Do not `return this` to simulate the partial IE11 implementation
|
14036
|
+
},
|
14037
|
+
delete: function(key) {
|
14038
|
+
key = this._transformKey(key);
|
14039
|
+
var idx = this._idx(key);
|
14040
|
+
if (idx === -1) {
|
14041
|
+
return false;
|
14042
|
+
}
|
14043
|
+
this._keys.splice(idx, 1);
|
14044
|
+
this._values.splice(idx, 1);
|
14045
|
+
this._lastKey = NaN;
|
14046
|
+
this._lastIndex = -1;
|
14047
|
+
return true;
|
14029
14048
|
}
|
14030
14049
|
};
|
14031
14050
|
|
14032
|
-
|
14051
|
+
// For now, always use `NgMapShim`, even if `window.Map` is available. Some native implementations
|
14052
|
+
// are still buggy (often in subtle ways) and can cause hard-to-debug failures. When native `Map`
|
14053
|
+
// implementations get more stable, we can reconsider switching to `window.Map` (when available).
|
14054
|
+
var NgMap = NgMapShim;
|
14055
|
+
|
14056
|
+
var $$MapProvider = [/** @this */function() {
|
14033
14057
|
this.$get = [function() {
|
14034
|
-
return
|
14058
|
+
return NgMap;
|
14035
14059
|
}];
|
14036
14060
|
}];
|
14037
14061
|
|
@@ -14106,11 +14130,7 @@ var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
|
|
14106
14130
|
var $injectorMinErr = minErr('$injector');
|
14107
14131
|
|
14108
14132
|
function stringifyFn(fn) {
|
14109
|
-
|
14110
|
-
// Creating a new string by adding `' '` at the end, to hack around some bug in Chrome v50/51
|
14111
|
-
// (See https://github.com/angular/angular.js/issues/14487.)
|
14112
|
-
// TODO (gkalpak): Remove workaround when Chrome v52 is released
|
14113
|
-
return Function.prototype.toString.call(fn) + ' ';
|
14133
|
+
return Function.prototype.toString.call(fn);
|
14114
14134
|
}
|
14115
14135
|
|
14116
14136
|
function extractArgs(fn) {
|
@@ -14684,7 +14704,7 @@ function createInjector(modulesToLoad, strictDi) {
|
|
14684
14704
|
var INSTANTIATING = {},
|
14685
14705
|
providerSuffix = 'Provider',
|
14686
14706
|
path = [],
|
14687
|
-
loadedModules = new
|
14707
|
+
loadedModules = new NgMap(),
|
14688
14708
|
providerCache = {
|
14689
14709
|
$provide: {
|
14690
14710
|
provider: supportObject(provider),
|
@@ -14792,7 +14812,7 @@ function createInjector(modulesToLoad, strictDi) {
|
|
14792
14812
|
var runBlocks = [], moduleFn;
|
14793
14813
|
forEach(modulesToLoad, function(module) {
|
14794
14814
|
if (loadedModules.get(module)) return;
|
14795
|
-
loadedModules.
|
14815
|
+
loadedModules.set(module, true);
|
14796
14816
|
|
14797
14817
|
function runInvokeQueue(queue) {
|
14798
14818
|
var i, ii;
|
@@ -15278,7 +15298,7 @@ var $$CoreAnimateJsProvider = /** @this */ function() {
|
|
15278
15298
|
// this is prefixed with Core since it conflicts with
|
15279
15299
|
// the animateQueueProvider defined in ngAnimate/animateQueue.js
|
15280
15300
|
var $$CoreAnimateQueueProvider = /** @this */ function() {
|
15281
|
-
var postDigestQueue = new
|
15301
|
+
var postDigestQueue = new NgMap();
|
15282
15302
|
var postDigestElements = [];
|
15283
15303
|
|
15284
15304
|
this.$get = ['$$AnimateRunner', '$rootScope',
|
@@ -15357,7 +15377,7 @@ var $$CoreAnimateQueueProvider = /** @this */ function() {
|
|
15357
15377
|
jqLiteRemoveClass(elm, toRemove);
|
15358
15378
|
}
|
15359
15379
|
});
|
15360
|
-
postDigestQueue.
|
15380
|
+
postDigestQueue.delete(element);
|
15361
15381
|
}
|
15362
15382
|
});
|
15363
15383
|
postDigestElements.length = 0;
|
@@ -15372,7 +15392,7 @@ var $$CoreAnimateQueueProvider = /** @this */ function() {
|
|
15372
15392
|
|
15373
15393
|
if (classesAdded || classesRemoved) {
|
15374
15394
|
|
15375
|
-
postDigestQueue.
|
15395
|
+
postDigestQueue.set(element, data);
|
15376
15396
|
postDigestElements.push(element);
|
15377
15397
|
|
15378
15398
|
if (postDigestElements.length === 1) {
|
@@ -16232,7 +16252,6 @@ function Browser(window, document, $log, $sniffer) {
|
|
16232
16252
|
};
|
16233
16253
|
|
16234
16254
|
cacheState();
|
16235
|
-
lastHistoryState = cachedState;
|
16236
16255
|
|
16237
16256
|
/**
|
16238
16257
|
* @name $browser#url
|
@@ -16286,8 +16305,6 @@ function Browser(window, document, $log, $sniffer) {
|
|
16286
16305
|
if ($sniffer.history && (!sameBase || !sameState)) {
|
16287
16306
|
history[replace ? 'replaceState' : 'pushState'](state, '', url);
|
16288
16307
|
cacheState();
|
16289
|
-
// Do the assignment again so that those two variables are referentially identical.
|
16290
|
-
lastHistoryState = cachedState;
|
16291
16308
|
} else {
|
16292
16309
|
if (!sameBase) {
|
16293
16310
|
pendingLocation = url;
|
@@ -16336,8 +16353,7 @@ function Browser(window, document, $log, $sniffer) {
|
|
16336
16353
|
|
16337
16354
|
function cacheStateAndFireUrlChange() {
|
16338
16355
|
pendingLocation = null;
|
16339
|
-
|
16340
|
-
fireUrlChange();
|
16356
|
+
fireStateOrUrlChange();
|
16341
16357
|
}
|
16342
16358
|
|
16343
16359
|
// This variable should be used *only* inside the cacheState function.
|
@@ -16351,11 +16367,16 @@ function Browser(window, document, $log, $sniffer) {
|
|
16351
16367
|
if (equals(cachedState, lastCachedState)) {
|
16352
16368
|
cachedState = lastCachedState;
|
16353
16369
|
}
|
16370
|
+
|
16354
16371
|
lastCachedState = cachedState;
|
16372
|
+
lastHistoryState = cachedState;
|
16355
16373
|
}
|
16356
16374
|
|
16357
|
-
function
|
16358
|
-
|
16375
|
+
function fireStateOrUrlChange() {
|
16376
|
+
var prevLastHistoryState = lastHistoryState;
|
16377
|
+
cacheState();
|
16378
|
+
|
16379
|
+
if (lastBrowserUrl === self.url() && prevLastHistoryState === cachedState) {
|
16359
16380
|
return;
|
16360
16381
|
}
|
16361
16382
|
|
@@ -16421,7 +16442,7 @@ function Browser(window, document, $log, $sniffer) {
|
|
16421
16442
|
* Needs to be exported to be able to check for changes that have been done in sync,
|
16422
16443
|
* as hashchange/popstate events fire in async.
|
16423
16444
|
*/
|
16424
|
-
self.$$checkUrlChange =
|
16445
|
+
self.$$checkUrlChange = fireStateOrUrlChange;
|
16425
16446
|
|
16426
16447
|
//////////////////////////////////////////////////////////////
|
16427
16448
|
// Misc API
|
@@ -17031,7 +17052,8 @@ function $TemplateCacheProvider() {
|
|
17031
17052
|
* * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The
|
17032
17053
|
* `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an
|
17033
17054
|
* object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a
|
17034
|
-
* component such as cloning the bound value to prevent accidental mutation of the outer value.
|
17055
|
+
* component such as cloning the bound value to prevent accidental mutation of the outer value. Note that this will
|
17056
|
+
* also be called when your bindings are initialized.
|
17035
17057
|
* * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on
|
17036
17058
|
* changes. Any actions that you wish to take in response to the changes that you detect must be
|
17037
17059
|
* invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook
|
@@ -17886,7 +17908,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
17886
17908
|
var bindingCache = createMap();
|
17887
17909
|
|
17888
17910
|
function parseIsolateBindings(scope, directiveName, isController) {
|
17889
|
-
var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/;
|
17911
|
+
var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*([\w$]*)\s*$/;
|
17890
17912
|
|
17891
17913
|
var bindings = createMap();
|
17892
17914
|
|
@@ -20058,7 +20080,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
20058
20080
|
if (error instanceof Error) {
|
20059
20081
|
$exceptionHandler(error);
|
20060
20082
|
}
|
20061
|
-
})
|
20083
|
+
});
|
20062
20084
|
|
20063
20085
|
return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {
|
20064
20086
|
var childBoundTranscludeFn = boundTranscludeFn;
|
@@ -22190,7 +22212,8 @@ function $HttpProvider() {
|
|
22190
22212
|
if ((config.cache || defaults.cache) && config.cache !== false &&
|
22191
22213
|
(config.method === 'GET' || config.method === 'JSONP')) {
|
22192
22214
|
cache = isObject(config.cache) ? config.cache
|
22193
|
-
|
22215
|
+
: isObject(/** @type {?} */ (defaults).cache)
|
22216
|
+
? /** @type {?} */ (defaults).cache
|
22194
22217
|
: defaultCache;
|
22195
22218
|
}
|
22196
22219
|
|
@@ -23368,6 +23391,8 @@ function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {
|
|
23368
23391
|
|
23369
23392
|
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
|
23370
23393
|
this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'
|
23394
|
+
|
23395
|
+
this.$$urlUpdatedByLocation = true;
|
23371
23396
|
};
|
23372
23397
|
|
23373
23398
|
this.$$parseLinkUrl = function(url, relHref) {
|
@@ -23445,7 +23470,7 @@ function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
|
|
23445
23470
|
withoutHashUrl = '';
|
23446
23471
|
if (isUndefined(withoutBaseUrl)) {
|
23447
23472
|
appBase = url;
|
23448
|
-
this.replace();
|
23473
|
+
/** @type {?} */ (this).replace();
|
23449
23474
|
}
|
23450
23475
|
}
|
23451
23476
|
}
|
@@ -23501,6 +23526,8 @@ function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
|
|
23501
23526
|
|
23502
23527
|
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
|
23503
23528
|
this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
|
23529
|
+
|
23530
|
+
this.$$urlUpdatedByLocation = true;
|
23504
23531
|
};
|
23505
23532
|
|
23506
23533
|
this.$$parseLinkUrl = function(url, relHref) {
|
@@ -23558,6 +23585,8 @@ function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {
|
|
23558
23585
|
this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
|
23559
23586
|
// include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'
|
23560
23587
|
this.$$absUrl = appBase + hashPrefix + this.$$url;
|
23588
|
+
|
23589
|
+
this.$$urlUpdatedByLocation = true;
|
23561
23590
|
};
|
23562
23591
|
|
23563
23592
|
}
|
@@ -23887,6 +23916,7 @@ forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], fun
|
|
23887
23916
|
// but we're changing the $$state reference to $browser.state() during the $digest
|
23888
23917
|
// so the modification window is narrow.
|
23889
23918
|
this.$$state = isUndefined(state) ? null : state;
|
23919
|
+
this.$$urlUpdatedByLocation = true;
|
23890
23920
|
|
23891
23921
|
return this;
|
23892
23922
|
};
|
@@ -24199,36 +24229,40 @@ function $LocationProvider() {
|
|
24199
24229
|
|
24200
24230
|
// update browser
|
24201
24231
|
$rootScope.$watch(function $locationWatch() {
|
24202
|
-
|
24203
|
-
|
24204
|
-
var oldState = $browser.state();
|
24205
|
-
var currentReplace = $location.$$replace;
|
24206
|
-
var urlOrStateChanged = oldUrl !== newUrl ||
|
24207
|
-
($location.$$html5 && $sniffer.history && oldState !== $location.$$state);
|
24232
|
+
if (initializing || $location.$$urlUpdatedByLocation) {
|
24233
|
+
$location.$$urlUpdatedByLocation = false;
|
24208
24234
|
|
24209
|
-
|
24210
|
-
|
24235
|
+
var oldUrl = trimEmptyHash($browser.url());
|
24236
|
+
var newUrl = trimEmptyHash($location.absUrl());
|
24237
|
+
var oldState = $browser.state();
|
24238
|
+
var currentReplace = $location.$$replace;
|
24239
|
+
var urlOrStateChanged = oldUrl !== newUrl ||
|
24240
|
+
($location.$$html5 && $sniffer.history && oldState !== $location.$$state);
|
24211
24241
|
|
24212
|
-
|
24213
|
-
|
24214
|
-
var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
|
24215
|
-
$location.$$state, oldState).defaultPrevented;
|
24242
|
+
if (initializing || urlOrStateChanged) {
|
24243
|
+
initializing = false;
|
24216
24244
|
|
24217
|
-
|
24218
|
-
|
24219
|
-
|
24245
|
+
$rootScope.$evalAsync(function() {
|
24246
|
+
var newUrl = $location.absUrl();
|
24247
|
+
var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
|
24248
|
+
$location.$$state, oldState).defaultPrevented;
|
24220
24249
|
|
24221
|
-
|
24222
|
-
|
24223
|
-
$location
|
24224
|
-
|
24225
|
-
if (
|
24226
|
-
|
24227
|
-
|
24250
|
+
// if the location was changed by a `$locationChangeStart` handler then stop
|
24251
|
+
// processing this location change
|
24252
|
+
if ($location.absUrl() !== newUrl) return;
|
24253
|
+
|
24254
|
+
if (defaultPrevented) {
|
24255
|
+
$location.$$parse(oldUrl);
|
24256
|
+
$location.$$state = oldState;
|
24257
|
+
} else {
|
24258
|
+
if (urlOrStateChanged) {
|
24259
|
+
setBrowserUrlWithFallback(newUrl, currentReplace,
|
24260
|
+
oldState === $location.$$state ? null : $location.$$state);
|
24261
|
+
}
|
24262
|
+
afterLocationChange(oldUrl, oldState);
|
24228
24263
|
}
|
24229
|
-
|
24230
|
-
|
24231
|
-
});
|
24264
|
+
});
|
24265
|
+
}
|
24232
24266
|
}
|
24233
24267
|
|
24234
24268
|
$location.$$replace = false;
|
@@ -24306,7 +24340,7 @@ function $LogProvider() {
|
|
24306
24340
|
this.debugEnabled = function(flag) {
|
24307
24341
|
if (isDefined(flag)) {
|
24308
24342
|
debug = flag;
|
24309
|
-
|
24343
|
+
return this;
|
24310
24344
|
} else {
|
24311
24345
|
return debug;
|
24312
24346
|
}
|
@@ -25128,6 +25162,13 @@ function findConstantAndWatchExpressions(ast, $filter) {
|
|
25128
25162
|
if (!property.value.constant) {
|
25129
25163
|
argsToWatch.push.apply(argsToWatch, property.value.toWatch);
|
25130
25164
|
}
|
25165
|
+
if (property.computed) {
|
25166
|
+
findConstantAndWatchExpressions(property.key, $filter);
|
25167
|
+
if (!property.key.constant) {
|
25168
|
+
argsToWatch.push.apply(argsToWatch, property.key.toWatch);
|
25169
|
+
}
|
25170
|
+
}
|
25171
|
+
|
25131
25172
|
});
|
25132
25173
|
ast.constant = allConstants;
|
25133
25174
|
ast.toWatch = argsToWatch;
|
@@ -26193,13 +26234,13 @@ function $ParseProvider() {
|
|
26193
26234
|
}
|
26194
26235
|
}
|
26195
26236
|
|
26196
|
-
function expressionInputDirtyCheck(newValue, oldValueOfValue) {
|
26237
|
+
function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) {
|
26197
26238
|
|
26198
26239
|
if (newValue == null || oldValueOfValue == null) { // null/undefined
|
26199
26240
|
return newValue === oldValueOfValue;
|
26200
26241
|
}
|
26201
26242
|
|
26202
|
-
if (typeof newValue === 'object') {
|
26243
|
+
if (typeof newValue === 'object' && !compareObjectIdentity) {
|
26203
26244
|
|
26204
26245
|
// attempt to convert the value to a primitive type
|
26205
26246
|
// TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can
|
@@ -26228,7 +26269,7 @@ function $ParseProvider() {
|
|
26228
26269
|
inputExpressions = inputExpressions[0];
|
26229
26270
|
return scope.$watch(function expressionInputWatch(scope) {
|
26230
26271
|
var newInputValue = inputExpressions(scope);
|
26231
|
-
if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {
|
26272
|
+
if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf, parsedExpression.literal)) {
|
26232
26273
|
lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);
|
26233
26274
|
oldInputValueOf = newInputValue && getValueOf(newInputValue);
|
26234
26275
|
}
|
@@ -26248,7 +26289,7 @@ function $ParseProvider() {
|
|
26248
26289
|
|
26249
26290
|
for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
|
26250
26291
|
var newInputValue = inputExpressions[i](scope);
|
26251
|
-
if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {
|
26292
|
+
if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i], parsedExpression.literal))) {
|
26252
26293
|
oldInputValues[i] = newInputValue;
|
26253
26294
|
oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);
|
26254
26295
|
}
|
@@ -27941,6 +27982,10 @@ function $RootScopeProvider() {
|
|
27941
27982
|
}
|
27942
27983
|
}
|
27943
27984
|
postDigestQueue.length = postDigestQueuePosition = 0;
|
27985
|
+
|
27986
|
+
// Check for changes to browser url that happened during the $digest
|
27987
|
+
// (for which no event is fired; e.g. via `history.pushState()`)
|
27988
|
+
$browser.$$checkUrlChange();
|
27944
27989
|
},
|
27945
27990
|
|
27946
27991
|
|
@@ -29646,7 +29691,10 @@ function $SnifferProvider() {
|
|
29646
29691
|
// (see https://developer.chrome.com/apps/api_index). If sandboxed, they can be detected by
|
29647
29692
|
// the presence of an extension runtime ID and the absence of other Chrome runtime APIs
|
29648
29693
|
// (see https://developer.chrome.com/apps/manifest/sandbox).
|
29694
|
+
// (NW.js apps have access to Chrome APIs, but do support `history`.)
|
29695
|
+
isNw = $window.nw && $window.nw.process,
|
29649
29696
|
isChromePackagedApp =
|
29697
|
+
!isNw &&
|
29650
29698
|
$window.chrome &&
|
29651
29699
|
($window.chrome.app && $window.chrome.app.runtime ||
|
29652
29700
|
!$window.chrome.app && $window.chrome.runtime && $window.chrome.runtime.id),
|
@@ -32407,7 +32455,8 @@ var htmlAnchorDirective = valueFn({
|
|
32407
32455
|
*
|
32408
32456
|
* @description
|
32409
32457
|
*
|
32410
|
-
* This directive sets the `disabled` attribute on the element
|
32458
|
+
* This directive sets the `disabled` attribute on the element (typically a form control,
|
32459
|
+
* e.g. `input`, `button`, `select` etc.) if the
|
32411
32460
|
* {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.
|
32412
32461
|
*
|
32413
32462
|
* A special directive is necessary because we cannot use interpolation inside the `disabled`
|
@@ -34913,15 +34962,27 @@ function isValidForStep(viewValue, stepBase, step) {
|
|
34913
34962
|
// and `viewValue` is expected to be a valid stringified number.
|
34914
34963
|
var value = Number(viewValue);
|
34915
34964
|
|
34965
|
+
var isNonIntegerValue = !isNumberInteger(value);
|
34966
|
+
var isNonIntegerStepBase = !isNumberInteger(stepBase);
|
34967
|
+
var isNonIntegerStep = !isNumberInteger(step);
|
34968
|
+
|
34916
34969
|
// Due to limitations in Floating Point Arithmetic (e.g. `0.3 - 0.2 !== 0.1` or
|
34917
34970
|
// `0.5 % 0.1 !== 0`), we need to convert all numbers to integers.
|
34918
|
-
if (
|
34919
|
-
var
|
34971
|
+
if (isNonIntegerValue || isNonIntegerStepBase || isNonIntegerStep) {
|
34972
|
+
var valueDecimals = isNonIntegerValue ? countDecimals(value) : 0;
|
34973
|
+
var stepBaseDecimals = isNonIntegerStepBase ? countDecimals(stepBase) : 0;
|
34974
|
+
var stepDecimals = isNonIntegerStep ? countDecimals(step) : 0;
|
34975
|
+
|
34976
|
+
var decimalCount = Math.max(valueDecimals, stepBaseDecimals, stepDecimals);
|
34920
34977
|
var multiplier = Math.pow(10, decimalCount);
|
34921
34978
|
|
34922
34979
|
value = value * multiplier;
|
34923
34980
|
stepBase = stepBase * multiplier;
|
34924
34981
|
step = step * multiplier;
|
34982
|
+
|
34983
|
+
if (isNonIntegerValue) value = Math.round(value);
|
34984
|
+
if (isNonIntegerStepBase) stepBase = Math.round(stepBase);
|
34985
|
+
if (isNonIntegerStep) step = Math.round(step);
|
34925
34986
|
}
|
34926
34987
|
|
34927
34988
|
return (value - stepBase) % step === 0;
|
@@ -35478,7 +35539,10 @@ var ngValueDirective = function() {
|
|
35478
35539
|
* makes it possible to use ngValue as a sort of one-way bind.
|
35479
35540
|
*/
|
35480
35541
|
function updateElementValue(element, attr, value) {
|
35481
|
-
|
35542
|
+
// Support: IE9 only
|
35543
|
+
// In IE9 values are converted to string (e.g. `input.value = null` results in `input.value === 'null'`).
|
35544
|
+
var propValue = isDefined(value) ? value : (msie === 9) ? '' : null;
|
35545
|
+
element.prop('value', propValue);
|
35482
35546
|
attr.$set('value', value);
|
35483
35547
|
}
|
35484
35548
|
|
@@ -36806,15 +36870,15 @@ forEach(
|
|
36806
36870
|
return {
|
36807
36871
|
restrict: 'A',
|
36808
36872
|
compile: function($element, attr) {
|
36809
|
-
//
|
36810
|
-
//
|
36811
|
-
//
|
36812
|
-
//
|
36813
|
-
var fn = $parse(attr[directiveName]
|
36873
|
+
// NOTE:
|
36874
|
+
// We expose the powerful `$event` object on the scope that provides access to the Window,
|
36875
|
+
// etc. This is OK, because expressions are not sandboxed any more (and the expression
|
36876
|
+
// sandbox was never meant to be a security feature anyway).
|
36877
|
+
var fn = $parse(attr[directiveName]);
|
36814
36878
|
return function ngEventHandler(scope, element) {
|
36815
36879
|
element.on(eventName, function(event) {
|
36816
36880
|
var callback = function() {
|
36817
|
-
fn(scope, {$event:event});
|
36881
|
+
fn(scope, {$event: event});
|
36818
36882
|
};
|
36819
36883
|
if (forceAsyncEvents[eventName] && $rootScope.$$phase) {
|
36820
36884
|
scope.$evalAsync(callback);
|
@@ -38693,6 +38757,29 @@ NgModelController.prototype = {
|
|
38693
38757
|
that.$commitViewValue();
|
38694
38758
|
});
|
38695
38759
|
}
|
38760
|
+
},
|
38761
|
+
|
38762
|
+
/**
|
38763
|
+
* @ngdoc method
|
38764
|
+
*
|
38765
|
+
* @name ngModel.NgModelController#$overrideModelOptions
|
38766
|
+
*
|
38767
|
+
* @description
|
38768
|
+
*
|
38769
|
+
* Override the current model options settings programmatically.
|
38770
|
+
*
|
38771
|
+
* The previous `ModelOptions` value will not be modified. Instead, a
|
38772
|
+
* new `ModelOptions` object will inherit from the previous one overriding
|
38773
|
+
* or inheriting settings that are defined in the given parameter.
|
38774
|
+
*
|
38775
|
+
* See {@link ngModelOptions} for information about what options can be specified
|
38776
|
+
* and how model option inheritance works.
|
38777
|
+
*
|
38778
|
+
* @param {Object} options a hash of settings to override the previous options
|
38779
|
+
*
|
38780
|
+
*/
|
38781
|
+
$overrideModelOptions: function(options) {
|
38782
|
+
this.$options = this.$options.createChild(options);
|
38696
38783
|
}
|
38697
38784
|
};
|
38698
38785
|
|
@@ -40956,11 +41043,13 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
|
|
40956
41043
|
* @multiElement
|
40957
41044
|
*
|
40958
41045
|
* @description
|
40959
|
-
* The `ngShow` directive shows or hides the given HTML element based on the expression
|
40960
|
-
*
|
40961
|
-
*
|
40962
|
-
*
|
40963
|
-
*
|
41046
|
+
* The `ngShow` directive shows or hides the given HTML element based on the expression provided to
|
41047
|
+
* the `ngShow` attribute.
|
41048
|
+
*
|
41049
|
+
* The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element.
|
41050
|
+
* The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an
|
41051
|
+
* `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see
|
41052
|
+
* {@link ng.directive:ngCsp ngCsp}).
|
40964
41053
|
*
|
40965
41054
|
* ```html
|
40966
41055
|
* <!-- when $scope.myValue is truthy (element is visible) -->
|
@@ -40970,31 +41059,32 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
|
|
40970
41059
|
* <div ng-show="myValue" class="ng-hide"></div>
|
40971
41060
|
* ```
|
40972
41061
|
*
|
40973
|
-
* When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added
|
40974
|
-
* attribute on the element causing it to become hidden. When truthy, the `.ng-hide`
|
40975
|
-
* from the element causing the element not to appear hidden.
|
41062
|
+
* When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added
|
41063
|
+
* to the class attribute on the element causing it to become hidden. When truthy, the `.ng-hide`
|
41064
|
+
* CSS class is removed from the element causing the element not to appear hidden.
|
40976
41065
|
*
|
40977
|
-
* ## Why is
|
41066
|
+
* ## Why is `!important` used?
|
40978
41067
|
*
|
40979
|
-
* You may be wondering why
|
40980
|
-
* can be easily overridden by heavier selectors. For example, something as
|
40981
|
-
* as changing the display style on a HTML list item would make hidden elements appear
|
40982
|
-
* This also becomes a bigger issue when dealing with CSS frameworks.
|
41068
|
+
* You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the
|
41069
|
+
* `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as
|
41070
|
+
* simple as changing the display style on a HTML list item would make hidden elements appear
|
41071
|
+
* visible. This also becomes a bigger issue when dealing with CSS frameworks.
|
40983
41072
|
*
|
40984
|
-
* By using
|
40985
|
-
* specificity (when
|
40986
|
-
* styling to change how to hide an element then it is just a
|
41073
|
+
* By using `!important`, the show and hide behavior will work as expected despite any clash between
|
41074
|
+
* CSS selector specificity (when `!important` isn't used with any conflicting styles). If a
|
41075
|
+
* developer chooses to override the styling to change how to hide an element then it is just a
|
41076
|
+
* matter of using `!important` in their own CSS code.
|
40987
41077
|
*
|
40988
41078
|
* ### Overriding `.ng-hide`
|
40989
41079
|
*
|
40990
|
-
* By default, the `.ng-hide` class will style the element with `display: none!important`. If you
|
40991
|
-
* the hide behavior with ngShow
|
40992
|
-
*
|
40993
|
-
* with extra animation classes that can be added.
|
41080
|
+
* By default, the `.ng-hide` class will style the element with `display: none !important`. If you
|
41081
|
+
* wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for
|
41082
|
+
* the `.ng-hide` CSS class. Note that the selector that needs to be used is actually
|
41083
|
+
* `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added.
|
40994
41084
|
*
|
40995
41085
|
* ```css
|
40996
41086
|
* .ng-hide:not(.ng-hide-animate) {
|
40997
|
-
* /*
|
41087
|
+
* /* These are just alternative ways of hiding an element */
|
40998
41088
|
* display: block!important;
|
40999
41089
|
* position: absolute;
|
41000
41090
|
* top: -9999px;
|
@@ -41002,29 +41092,20 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
|
|
41002
41092
|
* }
|
41003
41093
|
* ```
|
41004
41094
|
*
|
41005
|
-
* By default you don't need to override in CSS
|
41095
|
+
* By default you don't need to override anything in CSS and the animations will work around the
|
41096
|
+
* display style.
|
41006
41097
|
*
|
41007
41098
|
* ## A note about animations with `ngShow`
|
41008
41099
|
*
|
41009
|
-
* Animations in ngShow
|
41010
|
-
* is true and false. This system works like the animation system present with
|
41011
|
-
* you must also include the
|
41012
|
-
* so that
|
41100
|
+
* Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the
|
41101
|
+
* directive expression is true and false. This system works like the animation system present with
|
41102
|
+
* `ngClass` except that you must also include the `!important` flag to override the display
|
41103
|
+
* property so that the elements are not actually hidden during the animation.
|
41013
41104
|
*
|
41014
41105
|
* ```css
|
41015
|
-
*
|
41016
|
-
* //a working example can be found at the bottom of this page
|
41017
|
-
* //
|
41106
|
+
* /* A working example can be found at the bottom of this page. */
|
41018
41107
|
* .my-element.ng-hide-add, .my-element.ng-hide-remove {
|
41019
|
-
*
|
41020
|
-
* apply all styling in a show/hide animation */
|
41021
|
-
* transition: 0s linear all;
|
41022
|
-
* }
|
41023
|
-
*
|
41024
|
-
* .my-element.ng-hide-add-active,
|
41025
|
-
* .my-element.ng-hide-remove-active {
|
41026
|
-
* /* the transition is defined in the active class */
|
41027
|
-
* transition: 1s linear all;
|
41108
|
+
* transition: all 0.5s linear;
|
41028
41109
|
* }
|
41029
41110
|
*
|
41030
41111
|
* .my-element.ng-hide-add { ... }
|
@@ -41033,76 +41114,108 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
|
|
41033
41114
|
* .my-element.ng-hide-remove.ng-hide-remove-active { ... }
|
41034
41115
|
* ```
|
41035
41116
|
*
|
41036
|
-
* Keep in mind that, as of AngularJS version 1.3, there is no need to change the display
|
41037
|
-
*
|
41117
|
+
* Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property
|
41118
|
+
* to block during animation states - ngAnimate will automatically handle the style toggling for you.
|
41038
41119
|
*
|
41039
41120
|
* @animations
|
41040
|
-
* | Animation
|
41041
|
-
*
|
41042
|
-
* | {@link $animate#addClass addClass} `.ng-hide`
|
41043
|
-
* | {@link $animate#removeClass removeClass}
|
41121
|
+
* | Animation | Occurs |
|
41122
|
+
* |-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
|
41123
|
+
* | {@link $animate#addClass addClass} `.ng-hide` | After the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden. |
|
41124
|
+
* | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngShow` expression evaluates to a truthy value and just before contents are set to visible. |
|
41044
41125
|
*
|
41045
41126
|
* @element ANY
|
41046
|
-
* @param {expression} ngShow If the {@link guide/expression expression} is truthy
|
41047
|
-
*
|
41127
|
+
* @param {expression} ngShow If the {@link guide/expression expression} is truthy/falsy then the
|
41128
|
+
* element is shown/hidden respectively.
|
41048
41129
|
*
|
41049
41130
|
* @example
|
41050
|
-
|
41131
|
+
* A simple example, animating the element's opacity:
|
41132
|
+
*
|
41133
|
+
<example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-show-simple">
|
41051
41134
|
<file name="index.html">
|
41052
|
-
|
41053
|
-
<div>
|
41054
|
-
|
41055
|
-
<div class="check-element animate-show" ng-show="checked">
|
41056
|
-
<span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
|
41057
|
-
</div>
|
41135
|
+
Show: <input type="checkbox" ng-model="checked" aria-label="Toggle ngShow"><br />
|
41136
|
+
<div class="check-element animate-show-hide" ng-show="checked">
|
41137
|
+
I show up when your checkbox is checked.
|
41058
41138
|
</div>
|
41059
|
-
<div>
|
41060
|
-
Hide:
|
41061
|
-
<div class="check-element animate-show" ng-hide="checked">
|
41062
|
-
<span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
|
41063
|
-
</div>
|
41064
|
-
</div>
|
41065
|
-
</file>
|
41066
|
-
<file name="glyphicons.css">
|
41067
|
-
@import url(../../components/bootstrap-3.1.1/css/bootstrap.css);
|
41068
41139
|
</file>
|
41069
41140
|
<file name="animations.css">
|
41070
|
-
.animate-show {
|
41071
|
-
|
41141
|
+
.animate-show-hide.ng-hide {
|
41142
|
+
opacity: 0;
|
41143
|
+
}
|
41144
|
+
|
41145
|
+
.animate-show-hide.ng-hide-add,
|
41146
|
+
.animate-show-hide.ng-hide-remove {
|
41147
|
+
transition: all linear 0.5s;
|
41148
|
+
}
|
41149
|
+
|
41150
|
+
.check-element {
|
41151
|
+
border: 1px solid black;
|
41072
41152
|
opacity: 1;
|
41073
41153
|
padding: 10px;
|
41074
|
-
border: 1px solid black;
|
41075
|
-
background: white;
|
41076
41154
|
}
|
41155
|
+
</file>
|
41156
|
+
<file name="protractor.js" type="protractor">
|
41157
|
+
it('should check ngShow', function() {
|
41158
|
+
var checkbox = element(by.model('checked'));
|
41159
|
+
var checkElem = element(by.css('.check-element'));
|
41077
41160
|
|
41078
|
-
|
41079
|
-
|
41161
|
+
expect(checkElem.isDisplayed()).toBe(false);
|
41162
|
+
checkbox.click();
|
41163
|
+
expect(checkElem.isDisplayed()).toBe(true);
|
41164
|
+
});
|
41165
|
+
</file>
|
41166
|
+
</example>
|
41167
|
+
*
|
41168
|
+
* <hr />
|
41169
|
+
* @example
|
41170
|
+
* A more complex example, featuring different show/hide animations:
|
41171
|
+
*
|
41172
|
+
<example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-show-complex">
|
41173
|
+
<file name="index.html">
|
41174
|
+
Show: <input type="checkbox" ng-model="checked" aria-label="Toggle ngShow"><br />
|
41175
|
+
<div class="check-element funky-show-hide" ng-show="checked">
|
41176
|
+
I show up when your checkbox is checked.
|
41177
|
+
</div>
|
41178
|
+
</file>
|
41179
|
+
<file name="animations.css">
|
41180
|
+
body {
|
41181
|
+
overflow: hidden;
|
41182
|
+
perspective: 1000px;
|
41080
41183
|
}
|
41081
41184
|
|
41082
|
-
.
|
41083
|
-
|
41084
|
-
|
41085
|
-
|
41185
|
+
.funky-show-hide.ng-hide-add {
|
41186
|
+
transform: rotateZ(0);
|
41187
|
+
transform-origin: right;
|
41188
|
+
transition: all 0.5s ease-in-out;
|
41189
|
+
}
|
41190
|
+
|
41191
|
+
.funky-show-hide.ng-hide-add.ng-hide-add-active {
|
41192
|
+
transform: rotateZ(-135deg);
|
41193
|
+
}
|
41194
|
+
|
41195
|
+
.funky-show-hide.ng-hide-remove {
|
41196
|
+
transform: rotateY(90deg);
|
41197
|
+
transform-origin: left;
|
41198
|
+
transition: all 0.5s ease;
|
41199
|
+
}
|
41200
|
+
|
41201
|
+
.funky-show-hide.ng-hide-remove.ng-hide-remove-active {
|
41202
|
+
transform: rotateY(0);
|
41086
41203
|
}
|
41087
41204
|
|
41088
41205
|
.check-element {
|
41089
|
-
padding: 10px;
|
41090
41206
|
border: 1px solid black;
|
41091
|
-
|
41207
|
+
opacity: 1;
|
41208
|
+
padding: 10px;
|
41092
41209
|
}
|
41093
41210
|
</file>
|
41094
41211
|
<file name="protractor.js" type="protractor">
|
41095
|
-
|
41096
|
-
|
41097
|
-
|
41098
|
-
it('should check ng-show / ng-hide', function() {
|
41099
|
-
expect(thumbsUp.isDisplayed()).toBeFalsy();
|
41100
|
-
expect(thumbsDown.isDisplayed()).toBeTruthy();
|
41101
|
-
|
41102
|
-
element(by.model('checked')).click();
|
41212
|
+
it('should check ngShow', function() {
|
41213
|
+
var checkbox = element(by.model('checked'));
|
41214
|
+
var checkElem = element(by.css('.check-element'));
|
41103
41215
|
|
41104
|
-
expect(
|
41105
|
-
|
41216
|
+
expect(checkElem.isDisplayed()).toBe(false);
|
41217
|
+
checkbox.click();
|
41218
|
+
expect(checkElem.isDisplayed()).toBe(true);
|
41106
41219
|
});
|
41107
41220
|
</file>
|
41108
41221
|
</example>
|
@@ -41132,11 +41245,13 @@ var ngShowDirective = ['$animate', function($animate) {
|
|
41132
41245
|
* @multiElement
|
41133
41246
|
*
|
41134
41247
|
* @description
|
41135
|
-
* The `ngHide` directive shows or hides the given HTML element based on the expression
|
41136
|
-
*
|
41137
|
-
*
|
41138
|
-
*
|
41139
|
-
*
|
41248
|
+
* The `ngHide` directive shows or hides the given HTML element based on the expression provided to
|
41249
|
+
* the `ngHide` attribute.
|
41250
|
+
*
|
41251
|
+
* The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element.
|
41252
|
+
* The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an
|
41253
|
+
* `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see
|
41254
|
+
* {@link ng.directive:ngCsp ngCsp}).
|
41140
41255
|
*
|
41141
41256
|
* ```html
|
41142
41257
|
* <!-- when $scope.myValue is truthy (element is hidden) -->
|
@@ -41146,30 +41261,32 @@ var ngShowDirective = ['$animate', function($animate) {
|
|
41146
41261
|
* <div ng-hide="myValue"></div>
|
41147
41262
|
* ```
|
41148
41263
|
*
|
41149
|
-
* When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added
|
41150
|
-
* attribute on the element causing it to become hidden. When falsy, the `.ng-hide`
|
41151
|
-
* from the element causing the element not to appear hidden.
|
41264
|
+
* When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added
|
41265
|
+
* to the class attribute on the element causing it to become hidden. When falsy, the `.ng-hide`
|
41266
|
+
* CSS class is removed from the element causing the element not to appear hidden.
|
41152
41267
|
*
|
41153
|
-
* ## Why is
|
41268
|
+
* ## Why is `!important` used?
|
41154
41269
|
*
|
41155
|
-
* You may be wondering why
|
41156
|
-
* can be easily overridden by heavier selectors. For example, something as
|
41157
|
-
* as changing the display style on a HTML list item would make hidden elements appear
|
41158
|
-
* This also becomes a bigger issue when dealing with CSS frameworks.
|
41270
|
+
* You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the
|
41271
|
+
* `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as
|
41272
|
+
* simple as changing the display style on a HTML list item would make hidden elements appear
|
41273
|
+
* visible. This also becomes a bigger issue when dealing with CSS frameworks.
|
41159
41274
|
*
|
41160
|
-
* By using
|
41161
|
-
* specificity (when
|
41162
|
-
* styling to change how to hide an element then it is just a
|
41275
|
+
* By using `!important`, the show and hide behavior will work as expected despite any clash between
|
41276
|
+
* CSS selector specificity (when `!important` isn't used with any conflicting styles). If a
|
41277
|
+
* developer chooses to override the styling to change how to hide an element then it is just a
|
41278
|
+
* matter of using `!important` in their own CSS code.
|
41163
41279
|
*
|
41164
41280
|
* ### Overriding `.ng-hide`
|
41165
41281
|
*
|
41166
|
-
* By default, the `.ng-hide` class will style the element with `display: none!important`. If you
|
41167
|
-
* the hide behavior with ngShow
|
41168
|
-
* class
|
41282
|
+
* By default, the `.ng-hide` class will style the element with `display: none !important`. If you
|
41283
|
+
* wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for
|
41284
|
+
* the `.ng-hide` CSS class. Note that the selector that needs to be used is actually
|
41285
|
+
* `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added.
|
41169
41286
|
*
|
41170
41287
|
* ```css
|
41171
|
-
* .ng-hide {
|
41172
|
-
* /*
|
41288
|
+
* .ng-hide:not(.ng-hide-animate) {
|
41289
|
+
* /* These are just alternative ways of hiding an element */
|
41173
41290
|
* display: block!important;
|
41174
41291
|
* position: absolute;
|
41175
41292
|
* top: -9999px;
|
@@ -41177,20 +41294,20 @@ var ngShowDirective = ['$animate', function($animate) {
|
|
41177
41294
|
* }
|
41178
41295
|
* ```
|
41179
41296
|
*
|
41180
|
-
* By default you don't need to override in CSS anything and the animations will work around the
|
41297
|
+
* By default you don't need to override in CSS anything and the animations will work around the
|
41298
|
+
* display style.
|
41181
41299
|
*
|
41182
41300
|
* ## A note about animations with `ngHide`
|
41183
41301
|
*
|
41184
|
-
* Animations in ngShow
|
41185
|
-
* is true and false. This system works like the animation system present with
|
41186
|
-
*
|
41302
|
+
* Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the
|
41303
|
+
* directive expression is true and false. This system works like the animation system present with
|
41304
|
+
* `ngClass` except that you must also include the `!important` flag to override the display
|
41305
|
+
* property so that the elements are not actually hidden during the animation.
|
41187
41306
|
*
|
41188
41307
|
* ```css
|
41189
|
-
*
|
41190
|
-
* //a working example can be found at the bottom of this page
|
41191
|
-
* //
|
41308
|
+
* /* A working example can be found at the bottom of this page. */
|
41192
41309
|
* .my-element.ng-hide-add, .my-element.ng-hide-remove {
|
41193
|
-
* transition: 0.5s linear
|
41310
|
+
* transition: all 0.5s linear;
|
41194
41311
|
* }
|
41195
41312
|
*
|
41196
41313
|
* .my-element.ng-hide-add { ... }
|
@@ -41199,74 +41316,109 @@ var ngShowDirective = ['$animate', function($animate) {
|
|
41199
41316
|
* .my-element.ng-hide-remove.ng-hide-remove-active { ... }
|
41200
41317
|
* ```
|
41201
41318
|
*
|
41202
|
-
* Keep in mind that, as of AngularJS version 1.3, there is no need to change the display
|
41203
|
-
*
|
41319
|
+
* Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property
|
41320
|
+
* to block during animation states - ngAnimate will automatically handle the style toggling for you.
|
41204
41321
|
*
|
41205
41322
|
* @animations
|
41206
|
-
* | Animation
|
41207
|
-
*
|
41208
|
-
* | {@link $animate#addClass addClass} `.ng-hide`
|
41209
|
-
* | {@link $animate#removeClass removeClass}
|
41323
|
+
* | Animation | Occurs |
|
41324
|
+
* |-----------------------------------------------------|------------------------------------------------------------------------------------------------------------|
|
41325
|
+
* | {@link $animate#addClass addClass} `.ng-hide` | After the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden. |
|
41326
|
+
* | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngHide` expression evaluates to a non truthy value and just before contents are set to visible. |
|
41210
41327
|
*
|
41211
41328
|
*
|
41212
41329
|
* @element ANY
|
41213
|
-
* @param {expression} ngHide If the {@link guide/expression expression} is truthy then
|
41214
|
-
*
|
41330
|
+
* @param {expression} ngHide If the {@link guide/expression expression} is truthy/falsy then the
|
41331
|
+
* element is hidden/shown respectively.
|
41215
41332
|
*
|
41216
41333
|
* @example
|
41217
|
-
|
41334
|
+
* A simple example, animating the element's opacity:
|
41335
|
+
*
|
41336
|
+
<example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-hide-simple">
|
41218
41337
|
<file name="index.html">
|
41219
|
-
|
41220
|
-
<div>
|
41221
|
-
|
41222
|
-
<div class="check-element animate-hide" ng-show="checked">
|
41223
|
-
<span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
|
41224
|
-
</div>
|
41338
|
+
Hide: <input type="checkbox" ng-model="checked" aria-label="Toggle ngHide"><br />
|
41339
|
+
<div class="check-element animate-show-hide" ng-hide="checked">
|
41340
|
+
I hide when your checkbox is checked.
|
41225
41341
|
</div>
|
41226
|
-
<div>
|
41227
|
-
Hide:
|
41228
|
-
<div class="check-element animate-hide" ng-hide="checked">
|
41229
|
-
<span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
|
41230
|
-
</div>
|
41231
|
-
</div>
|
41232
|
-
</file>
|
41233
|
-
<file name="glyphicons.css">
|
41234
|
-
@import url(../../components/bootstrap-3.1.1/css/bootstrap.css);
|
41235
41342
|
</file>
|
41236
41343
|
<file name="animations.css">
|
41237
|
-
.animate-hide {
|
41344
|
+
.animate-show-hide.ng-hide {
|
41345
|
+
opacity: 0;
|
41346
|
+
}
|
41347
|
+
|
41348
|
+
.animate-show-hide.ng-hide-add,
|
41349
|
+
.animate-show-hide.ng-hide-remove {
|
41238
41350
|
transition: all linear 0.5s;
|
41239
|
-
|
41351
|
+
}
|
41352
|
+
|
41353
|
+
.check-element {
|
41354
|
+
border: 1px solid black;
|
41240
41355
|
opacity: 1;
|
41241
41356
|
padding: 10px;
|
41242
|
-
border: 1px solid black;
|
41243
|
-
background: white;
|
41244
41357
|
}
|
41358
|
+
</file>
|
41359
|
+
<file name="protractor.js" type="protractor">
|
41360
|
+
it('should check ngHide', function() {
|
41361
|
+
var checkbox = element(by.model('checked'));
|
41362
|
+
var checkElem = element(by.css('.check-element'));
|
41245
41363
|
|
41246
|
-
|
41247
|
-
|
41248
|
-
|
41249
|
-
|
41364
|
+
expect(checkElem.isDisplayed()).toBe(true);
|
41365
|
+
checkbox.click();
|
41366
|
+
expect(checkElem.isDisplayed()).toBe(false);
|
41367
|
+
});
|
41368
|
+
</file>
|
41369
|
+
</example>
|
41370
|
+
*
|
41371
|
+
* <hr />
|
41372
|
+
* @example
|
41373
|
+
* A more complex example, featuring different show/hide animations:
|
41374
|
+
*
|
41375
|
+
<example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-hide-complex">
|
41376
|
+
<file name="index.html">
|
41377
|
+
Hide: <input type="checkbox" ng-model="checked" aria-label="Toggle ngHide"><br />
|
41378
|
+
<div class="check-element funky-show-hide" ng-hide="checked">
|
41379
|
+
I hide when your checkbox is checked.
|
41380
|
+
</div>
|
41381
|
+
</file>
|
41382
|
+
<file name="animations.css">
|
41383
|
+
body {
|
41384
|
+
overflow: hidden;
|
41385
|
+
perspective: 1000px;
|
41386
|
+
}
|
41387
|
+
|
41388
|
+
.funky-show-hide.ng-hide-add {
|
41389
|
+
transform: rotateZ(0);
|
41390
|
+
transform-origin: right;
|
41391
|
+
transition: all 0.5s ease-in-out;
|
41392
|
+
}
|
41393
|
+
|
41394
|
+
.funky-show-hide.ng-hide-add.ng-hide-add-active {
|
41395
|
+
transform: rotateZ(-135deg);
|
41396
|
+
}
|
41397
|
+
|
41398
|
+
.funky-show-hide.ng-hide-remove {
|
41399
|
+
transform: rotateY(90deg);
|
41400
|
+
transform-origin: left;
|
41401
|
+
transition: all 0.5s ease;
|
41402
|
+
}
|
41403
|
+
|
41404
|
+
.funky-show-hide.ng-hide-remove.ng-hide-remove-active {
|
41405
|
+
transform: rotateY(0);
|
41250
41406
|
}
|
41251
41407
|
|
41252
41408
|
.check-element {
|
41253
|
-
padding: 10px;
|
41254
41409
|
border: 1px solid black;
|
41255
|
-
|
41410
|
+
opacity: 1;
|
41411
|
+
padding: 10px;
|
41256
41412
|
}
|
41257
41413
|
</file>
|
41258
41414
|
<file name="protractor.js" type="protractor">
|
41259
|
-
|
41260
|
-
|
41261
|
-
|
41262
|
-
it('should check ng-show / ng-hide', function() {
|
41263
|
-
expect(thumbsUp.isDisplayed()).toBeFalsy();
|
41264
|
-
expect(thumbsDown.isDisplayed()).toBeTruthy();
|
41415
|
+
it('should check ngHide', function() {
|
41416
|
+
var checkbox = element(by.model('checked'));
|
41417
|
+
var checkElem = element(by.css('.check-element'));
|
41265
41418
|
|
41266
|
-
|
41267
|
-
|
41268
|
-
expect(
|
41269
|
-
expect(thumbsDown.isDisplayed()).toBeFalsy();
|
41419
|
+
expect(checkElem.isDisplayed()).toBe(true);
|
41420
|
+
checkbox.click();
|
41421
|
+
expect(checkElem.isDisplayed()).toBe(false);
|
41270
41422
|
});
|
41271
41423
|
</file>
|
41272
41424
|
</example>
|
@@ -41861,7 +42013,7 @@ var SelectController =
|
|
41861
42013
|
['$element', '$scope', /** @this */ function($element, $scope) {
|
41862
42014
|
|
41863
42015
|
var self = this,
|
41864
|
-
optionsMap = new
|
42016
|
+
optionsMap = new NgMap();
|
41865
42017
|
|
41866
42018
|
self.selectValueMap = {}; // Keys are the hashed values, values the original values
|
41867
42019
|
|
@@ -41982,7 +42134,7 @@ var SelectController =
|
|
41982
42134
|
self.emptyOption = element;
|
41983
42135
|
}
|
41984
42136
|
var count = optionsMap.get(value) || 0;
|
41985
|
-
optionsMap.
|
42137
|
+
optionsMap.set(value, count + 1);
|
41986
42138
|
// Only render at the end of a digest. This improves render performance when many options
|
41987
42139
|
// are added during a digest and ensures all relevant options are correctly marked as selected
|
41988
42140
|
scheduleRender();
|
@@ -41993,13 +42145,13 @@ var SelectController =
|
|
41993
42145
|
var count = optionsMap.get(value);
|
41994
42146
|
if (count) {
|
41995
42147
|
if (count === 1) {
|
41996
|
-
optionsMap.
|
42148
|
+
optionsMap.delete(value);
|
41997
42149
|
if (value === '') {
|
41998
42150
|
self.hasEmptyOption = false;
|
41999
42151
|
self.emptyOption = undefined;
|
42000
42152
|
}
|
42001
42153
|
} else {
|
42002
|
-
optionsMap.
|
42154
|
+
optionsMap.set(value, count - 1);
|
42003
42155
|
}
|
42004
42156
|
}
|
42005
42157
|
};
|
@@ -42126,7 +42278,7 @@ var SelectController =
|
|
42126
42278
|
var removeValue = optionAttrs.value;
|
42127
42279
|
|
42128
42280
|
self.removeOption(removeValue);
|
42129
|
-
|
42281
|
+
scheduleRender();
|
42130
42282
|
|
42131
42283
|
if (self.multiple && currentValue && currentValue.indexOf(removeValue) !== -1 ||
|
42132
42284
|
currentValue === removeValue
|
@@ -42451,9 +42603,9 @@ var selectDirective = function() {
|
|
42451
42603
|
|
42452
42604
|
// Write value now needs to set the selected property of each matching option
|
42453
42605
|
selectCtrl.writeValue = function writeMultipleValue(value) {
|
42454
|
-
var items = new HashMap(value);
|
42455
42606
|
forEach(element.find('option'), function(option) {
|
42456
|
-
option.selected =
|
42607
|
+
option.selected = !!value && (includes(value, option.value) ||
|
42608
|
+
includes(value, selectCtrl.selectValueMap[option.value]));
|
42457
42609
|
});
|
42458
42610
|
};
|
42459
42611
|
|