angularjs-rails 1.2.14 → 1.2.15
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 +2 -2
- data/vendor/assets/javascripts/angular-animate.js +4 -5
- data/vendor/assets/javascripts/angular-cookies.js +8 -9
- data/vendor/assets/javascripts/angular-loader.js +6 -8
- data/vendor/assets/javascripts/angular-mocks.js +10 -11
- data/vendor/assets/javascripts/angular-resource.js +13 -3
- data/vendor/assets/javascripts/angular-route.js +139 -134
- data/vendor/assets/javascripts/angular-sanitize.js +2 -2
- data/vendor/assets/javascripts/angular-scenario.js +190 -81
- data/vendor/assets/javascripts/angular-touch.js +16 -2
- data/vendor/assets/javascripts/angular.js +196 -81
- data/vendor/assets/javascripts/unstable/angular-animate.js +1613 -0
- data/vendor/assets/javascripts/unstable/angular-cookies.js +40 -29
- data/vendor/assets/javascripts/unstable/angular-loader.js +166 -58
- data/vendor/assets/javascripts/unstable/angular-mocks.js +832 -535
- data/vendor/assets/javascripts/unstable/angular-resource.js +266 -196
- data/vendor/assets/javascripts/unstable/angular-route.js +927 -0
- data/vendor/assets/javascripts/unstable/angular-sanitize.js +246 -180
- data/vendor/assets/javascripts/unstable/angular-scenario.js +19167 -13895
- data/vendor/assets/javascripts/unstable/{angular-mobile.js → angular-touch.js} +241 -126
- data/vendor/assets/javascripts/unstable/angular.js +12891 -8032
- metadata +5 -3
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.2.
|
2
|
+
* @license AngularJS v1.2.15
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -259,7 +259,7 @@ function htmlParser( html, handler ) {
|
|
259
259
|
match = html.match( DOCTYPE_REGEXP );
|
260
260
|
|
261
261
|
if ( match ) {
|
262
|
-
html = html.replace( match[0]
|
262
|
+
html = html.replace( match[0], '');
|
263
263
|
chars = false;
|
264
264
|
}
|
265
265
|
// end tag
|
@@ -9790,7 +9790,7 @@ if ( typeof module === "object" && module && typeof module.exports === "object"
|
|
9790
9790
|
})( window );
|
9791
9791
|
|
9792
9792
|
/**
|
9793
|
-
* @license AngularJS v1.2.
|
9793
|
+
* @license AngularJS v1.2.15
|
9794
9794
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
9795
9795
|
* License: MIT
|
9796
9796
|
*/
|
@@ -9860,7 +9860,7 @@ function minErr(module) {
|
|
9860
9860
|
return match;
|
9861
9861
|
});
|
9862
9862
|
|
9863
|
-
message = message + '\nhttp://errors.angularjs.org/1.2.
|
9863
|
+
message = message + '\nhttp://errors.angularjs.org/1.2.15/' +
|
9864
9864
|
(module ? module + '/' : '') + code;
|
9865
9865
|
for (i = 2; i < arguments.length; i++) {
|
9866
9866
|
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
|
@@ -9916,6 +9916,7 @@ function minErr(module) {
|
|
9916
9916
|
-isWindow,
|
9917
9917
|
-isScope,
|
9918
9918
|
-isFile,
|
9919
|
+
-isBlob,
|
9919
9920
|
-isBoolean,
|
9920
9921
|
-trim,
|
9921
9922
|
-isElement,
|
@@ -10437,6 +10438,11 @@ function isFile(obj) {
|
|
10437
10438
|
}
|
10438
10439
|
|
10439
10440
|
|
10441
|
+
function isBlob(obj) {
|
10442
|
+
return toString.call(obj) === '[object Blob]';
|
10443
|
+
}
|
10444
|
+
|
10445
|
+
|
10440
10446
|
function isBoolean(value) {
|
10441
10447
|
return typeof value === 'boolean';
|
10442
10448
|
}
|
@@ -11106,6 +11112,41 @@ function angularInit(element, bootstrap) {
|
|
11106
11112
|
* Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually.
|
11107
11113
|
* They must use {@link ng.directive:ngApp ngApp}.
|
11108
11114
|
*
|
11115
|
+
* Angular will detect if it has been loaded into the browser more than once and only allow the
|
11116
|
+
* first loaded script to be bootstrapped and will report a warning to the browser console for
|
11117
|
+
* each of the subsequent scripts. This prevents strange results in applications, where otherwise
|
11118
|
+
* multiple instances of Angular try to work on the DOM.
|
11119
|
+
*
|
11120
|
+
* <example name="multi-bootstrap" module="multi-bootstrap">
|
11121
|
+
* <file name="index.html">
|
11122
|
+
* <script src="../../../angular.js"></script>
|
11123
|
+
* <div ng-controller="BrokenTable">
|
11124
|
+
* <table>
|
11125
|
+
* <tr>
|
11126
|
+
* <th ng-repeat="heading in headings">{{heading}}</th>
|
11127
|
+
* </tr>
|
11128
|
+
* <tr ng-repeat="filling in fillings">
|
11129
|
+
* <td ng-repeat="fill in filling">{{fill}}</td>
|
11130
|
+
* </tr>
|
11131
|
+
* </table>
|
11132
|
+
* </div>
|
11133
|
+
* </file>
|
11134
|
+
* <file name="controller.js">
|
11135
|
+
* var app = angular.module('multi-bootstrap', [])
|
11136
|
+
*
|
11137
|
+
* .controller('BrokenTable', function($scope) {
|
11138
|
+
* $scope.headings = ['One', 'Two', 'Three'];
|
11139
|
+
* $scope.fillings = [[1, 2, 3], ['A', 'B', 'C'], [7, 8, 9]];
|
11140
|
+
* });
|
11141
|
+
* </file>
|
11142
|
+
* <file name="protractor.js" type="protractor">
|
11143
|
+
* it('should only insert one table cell for each item in $scope.fillings', function() {
|
11144
|
+
* expect(element.all(by.css('td')).count())
|
11145
|
+
* .toBe(9);
|
11146
|
+
* });
|
11147
|
+
* </file>
|
11148
|
+
* </example>
|
11149
|
+
*
|
11109
11150
|
* @param {Element} element DOM element which is the root of angular application.
|
11110
11151
|
* @param {Array<String|Function|Array>=} modules an array of modules to load into the application.
|
11111
11152
|
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
@@ -11323,16 +11364,16 @@ function setupModuleLoader(window) {
|
|
11323
11364
|
* myModule.value('appName', 'MyCoolApp');
|
11324
11365
|
*
|
11325
11366
|
* // configure existing services inside initialization blocks.
|
11326
|
-
* myModule.config(function($locationProvider) {
|
11367
|
+
* myModule.config(['$locationProvider', function($locationProvider) {
|
11327
11368
|
* // Configure existing providers
|
11328
11369
|
* $locationProvider.hashPrefix('!');
|
11329
|
-
* });
|
11370
|
+
* }]);
|
11330
11371
|
* ```
|
11331
11372
|
*
|
11332
11373
|
* Then you can create an injector and load your modules like this:
|
11333
11374
|
*
|
11334
11375
|
* ```js
|
11335
|
-
* var injector = angular.injector(['ng', '
|
11376
|
+
* var injector = angular.injector(['ng', 'myModule'])
|
11336
11377
|
* ```
|
11337
11378
|
*
|
11338
11379
|
* However it's more likely that you'll just use
|
@@ -11341,7 +11382,7 @@ function setupModuleLoader(window) {
|
|
11341
11382
|
*
|
11342
11383
|
* @param {!string} name The name of the module to create or retrieve.
|
11343
11384
|
* @param {Array.<string>=} requires If specified then new module is being created. If
|
11344
|
-
* unspecified then the
|
11385
|
+
* unspecified then the module is being retrieved for further configuration.
|
11345
11386
|
* @param {Function} configFn Optional configuration function for the module. Same as
|
11346
11387
|
* {@link angular.Module#config Module#config()}.
|
11347
11388
|
* @returns {module} new module with the {@link angular.Module} api.
|
@@ -11382,7 +11423,6 @@ function setupModuleLoader(window) {
|
|
11382
11423
|
* @ngdoc property
|
11383
11424
|
* @name angular.Module#requires
|
11384
11425
|
* @module ng
|
11385
|
-
* @propertyOf angular.Module
|
11386
11426
|
* @returns {Array.<string>} List of module names which must be loaded before this module.
|
11387
11427
|
* @description
|
11388
11428
|
* Holds the list of modules which the injector will load before the current module is
|
@@ -11394,7 +11434,6 @@ function setupModuleLoader(window) {
|
|
11394
11434
|
* @ngdoc property
|
11395
11435
|
* @name angular.Module#name
|
11396
11436
|
* @module ng
|
11397
|
-
* @propertyOf angular.Module
|
11398
11437
|
* @returns {string} Name of the module.
|
11399
11438
|
* @description
|
11400
11439
|
*/
|
@@ -11672,11 +11711,11 @@ function setupModuleLoader(window) {
|
|
11672
11711
|
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
|
11673
11712
|
*/
|
11674
11713
|
var version = {
|
11675
|
-
full: '1.2.
|
11714
|
+
full: '1.2.15', // all of these placeholder strings will be replaced by grunt's
|
11676
11715
|
major: 1, // package task
|
11677
11716
|
minor: 2,
|
11678
|
-
dot:
|
11679
|
-
codeName: '
|
11717
|
+
dot: 15,
|
11718
|
+
codeName: 'beer-underestimating'
|
11680
11719
|
};
|
11681
11720
|
|
11682
11721
|
|
@@ -12164,11 +12203,15 @@ function jqLiteInheritedData(element, name, value) {
|
|
12164
12203
|
var names = isArray(name) ? name : [name];
|
12165
12204
|
|
12166
12205
|
while (element.length) {
|
12167
|
-
|
12206
|
+
var node = element[0];
|
12168
12207
|
for (var i = 0, ii = names.length; i < ii; i++) {
|
12169
12208
|
if ((value = element.data(names[i])) !== undefined) return value;
|
12170
12209
|
}
|
12171
|
-
|
12210
|
+
|
12211
|
+
// If dealing with a document fragment node with a host element, and no parent, use the host
|
12212
|
+
// element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
|
12213
|
+
// to lookup parent controllers.
|
12214
|
+
element = jqLite(node.parentNode || (node.nodeType === 11 && node.host));
|
12172
12215
|
}
|
12173
12216
|
}
|
12174
12217
|
|
@@ -12257,7 +12300,7 @@ forEach({
|
|
12257
12300
|
return jqLite(element).data('$isolateScope') || jqLite(element).data('$isolateScopeNoTemplate');
|
12258
12301
|
},
|
12259
12302
|
|
12260
|
-
controller: jqLiteController
|
12303
|
+
controller: jqLiteController,
|
12261
12304
|
|
12262
12305
|
injector: function(element) {
|
12263
12306
|
return jqLiteInheritedData(element, '$injector');
|
@@ -14130,7 +14173,6 @@ function Browser(window, document, $log, $sniffer) {
|
|
14130
14173
|
|
14131
14174
|
/**
|
14132
14175
|
* @name $browser#onUrlChange
|
14133
|
-
* @TODO(vojta): refactor to use node's syntax for events
|
14134
14176
|
*
|
14135
14177
|
* @description
|
14136
14178
|
* Register callback function that will be called, when url changes.
|
@@ -14151,6 +14193,7 @@ function Browser(window, document, $log, $sniffer) {
|
|
14151
14193
|
* @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
|
14152
14194
|
*/
|
14153
14195
|
self.onUrlChange = function(callback) {
|
14196
|
+
// TODO(vojta): refactor to use node's syntax for events
|
14154
14197
|
if (!urlChangeInit) {
|
14155
14198
|
// We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
|
14156
14199
|
// don't fire popstate when user change the address bar and don't fire hashchange when url
|
@@ -14527,15 +14570,11 @@ function $CacheFactoryProvider() {
|
|
14527
14570
|
* `$templateCache` service directly.
|
14528
14571
|
*
|
14529
14572
|
* Adding via the `script` tag:
|
14573
|
+
*
|
14530
14574
|
* ```html
|
14531
|
-
*
|
14532
|
-
*
|
14533
|
-
*
|
14534
|
-
* This is the content of the template
|
14535
|
-
* </script>
|
14536
|
-
* </head>
|
14537
|
-
* ...
|
14538
|
-
* </html>
|
14575
|
+
* <script type="text/ng-template" id="templateId.html">
|
14576
|
+
* <p>This is the content of the template</p>
|
14577
|
+
* </script>
|
14539
14578
|
* ```
|
14540
14579
|
*
|
14541
14580
|
* **Note:** the `script` tag containing the template does not need to be included in the `head` of
|
@@ -15072,7 +15111,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
15072
15111
|
Suffix = 'Directive',
|
15073
15112
|
COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
|
15074
15113
|
CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
|
15075
|
-
TABLE_CONTENT_REGEXP = /^<\s*(tr|th|td|tbody)(\s+[^>]*)?>/i;
|
15114
|
+
TABLE_CONTENT_REGEXP = /^<\s*(tr|th|td|thead|tbody|tfoot)(\s+[^>]*)?>/i;
|
15076
15115
|
|
15077
15116
|
// Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes
|
15078
15117
|
// The assumption is that future DOM event attribute names will begin with
|
@@ -16218,16 +16257,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
16218
16257
|
template = trim(template);
|
16219
16258
|
if ((type = TABLE_CONTENT_REGEXP.exec(template))) {
|
16220
16259
|
type = type[1].toLowerCase();
|
16221
|
-
var table = jqLite('<table>' + template + '</table>')
|
16222
|
-
|
16223
|
-
|
16224
|
-
if (tbody.length && type !== 'tbody') {
|
16225
|
-
table = tbody;
|
16260
|
+
var table = jqLite('<table>' + template + '</table>');
|
16261
|
+
if (/(thead|tbody|tfoot)/.test(type)) {
|
16262
|
+
return table.children(type);
|
16226
16263
|
}
|
16227
|
-
|
16228
|
-
|
16264
|
+
table = table.children('tbody');
|
16265
|
+
if (type === 'tr') {
|
16266
|
+
return table.children('tr');
|
16229
16267
|
}
|
16230
|
-
return table.contents();
|
16268
|
+
return table.children('tr').contents();
|
16231
16269
|
}
|
16232
16270
|
return jqLite('<div>' +
|
16233
16271
|
template +
|
@@ -16697,6 +16735,22 @@ function $ControllerProvider() {
|
|
16697
16735
|
*
|
16698
16736
|
* @description
|
16699
16737
|
* A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
|
16738
|
+
*
|
16739
|
+
* @example
|
16740
|
+
<example>
|
16741
|
+
<file name="index.html">
|
16742
|
+
<div ng-controller="MainCtrl">
|
16743
|
+
<p>$document title: <b ng-bind="title"></b></p>
|
16744
|
+
<p>window.document title: <b ng-bind="windowTitle"></b></p>
|
16745
|
+
</div>
|
16746
|
+
</file>
|
16747
|
+
<file name="script.js">
|
16748
|
+
function MainCtrl($scope, $document) {
|
16749
|
+
$scope.title = $document[0].title;
|
16750
|
+
$scope.windowTitle = angular.element(window.document)[0].title;
|
16751
|
+
}
|
16752
|
+
</file>
|
16753
|
+
</example>
|
16700
16754
|
*/
|
16701
16755
|
function $DocumentProvider(){
|
16702
16756
|
this.$get = ['$window', function(window){
|
@@ -16847,7 +16901,7 @@ function $HttpProvider() {
|
|
16847
16901
|
|
16848
16902
|
// transform outgoing request data
|
16849
16903
|
transformRequest: [function(d) {
|
16850
|
-
return isObject(d) && !isFile(d) ? toJson(d) : d;
|
16904
|
+
return isObject(d) && !isFile(d) && !isBlob(d) ? toJson(d) : d;
|
16851
16905
|
}],
|
16852
16906
|
|
16853
16907
|
// default headers
|
@@ -16980,9 +17034,8 @@ function $HttpProvider() {
|
|
16980
17034
|
*
|
16981
17035
|
* # Shortcut methods
|
16982
17036
|
*
|
16983
|
-
*
|
16984
|
-
*
|
16985
|
-
* were created:
|
17037
|
+
* Shortcut methods are also available. All shortcut methods require passing in the URL, and
|
17038
|
+
* request data must be passed in for POST/PUT requests.
|
16986
17039
|
*
|
16987
17040
|
* ```js
|
16988
17041
|
* $http.get('/someUrl').success(successCallback);
|
@@ -17317,7 +17370,7 @@ function $HttpProvider() {
|
|
17317
17370
|
* - **headers** – `{function([headerName])}` – Header getter function.
|
17318
17371
|
* - **config** – `{Object}` – The configuration object that was used to generate the request.
|
17319
17372
|
*
|
17320
|
-
* @property {Array
|
17373
|
+
* @property {Array.<Object>} pendingRequests Array of config objects for currently pending
|
17321
17374
|
* requests. This is primarily meant to be used for debugging purposes.
|
17322
17375
|
*
|
17323
17376
|
*
|
@@ -17619,7 +17672,6 @@ function $HttpProvider() {
|
|
17619
17672
|
/**
|
17620
17673
|
* @ngdoc property
|
17621
17674
|
* @name $http#defaults
|
17622
|
-
* @propertyOf ng.$http
|
17623
17675
|
*
|
17624
17676
|
* @description
|
17625
17677
|
* Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of
|
@@ -17924,9 +17976,11 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|
17924
17976
|
jsonpDone = xhr = null;
|
17925
17977
|
|
17926
17978
|
// fix status code when it is 0 (0 status is undocumented).
|
17927
|
-
// Occurs when accessing file resources.
|
17928
|
-
//
|
17929
|
-
|
17979
|
+
// Occurs when accessing file resources or on Android 4.1 stock browser
|
17980
|
+
// while retrieving files from application cache.
|
17981
|
+
if (status === 0) {
|
17982
|
+
status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;
|
17983
|
+
}
|
17930
17984
|
|
17931
17985
|
// normalize IE bug (http://bugs.jquery.com/ticket/1450)
|
17932
17986
|
status = status == 1223 ? 204 : status;
|
@@ -18370,7 +18424,7 @@ function $IntervalProvider() {
|
|
18370
18424
|
* @description
|
18371
18425
|
* Cancels a task associated with the `promise`.
|
18372
18426
|
*
|
18373
|
-
* @param {
|
18427
|
+
* @param {promise} promise returned by the `$interval` function.
|
18374
18428
|
* @returns {boolean} Returns `true` if the task was successfully canceled.
|
18375
18429
|
*/
|
18376
18430
|
interval.cancel = function(promise) {
|
@@ -20696,7 +20750,7 @@ function $ParseProvider() {
|
|
20696
20750
|
*
|
20697
20751
|
* Because `finally` is a reserved word in JavaScript and reserved keywords are not supported as
|
20698
20752
|
* property names by ES3, you'll need to invoke the method like `promise['finally'](callback)` to
|
20699
|
-
* make your code IE8 compatible.
|
20753
|
+
* make your code IE8 and Android 2.x compatible.
|
20700
20754
|
*
|
20701
20755
|
* # Chaining promises
|
20702
20756
|
*
|
@@ -21109,21 +21163,32 @@ function qFactory(nextTick, exceptionHandler) {
|
|
21109
21163
|
}
|
21110
21164
|
|
21111
21165
|
function $$RAFProvider(){ //rAF
|
21112
|
-
this.$get = ['$window', function($window) {
|
21166
|
+
this.$get = ['$window', '$timeout', function($window, $timeout) {
|
21113
21167
|
var requestAnimationFrame = $window.requestAnimationFrame ||
|
21114
|
-
$window.webkitRequestAnimationFrame
|
21168
|
+
$window.webkitRequestAnimationFrame ||
|
21169
|
+
$window.mozRequestAnimationFrame;
|
21115
21170
|
|
21116
21171
|
var cancelAnimationFrame = $window.cancelAnimationFrame ||
|
21117
|
-
$window.webkitCancelAnimationFrame
|
21118
|
-
|
21119
|
-
|
21120
|
-
|
21121
|
-
|
21122
|
-
|
21123
|
-
|
21124
|
-
|
21172
|
+
$window.webkitCancelAnimationFrame ||
|
21173
|
+
$window.mozCancelAnimationFrame ||
|
21174
|
+
$window.webkitCancelRequestAnimationFrame;
|
21175
|
+
|
21176
|
+
var rafSupported = !!requestAnimationFrame;
|
21177
|
+
var raf = rafSupported
|
21178
|
+
? function(fn) {
|
21179
|
+
var id = requestAnimationFrame(fn);
|
21180
|
+
return function() {
|
21181
|
+
cancelAnimationFrame(id);
|
21182
|
+
};
|
21183
|
+
}
|
21184
|
+
: function(fn) {
|
21185
|
+
var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666
|
21186
|
+
return function() {
|
21187
|
+
$timeout.cancel(timer);
|
21188
|
+
};
|
21189
|
+
};
|
21125
21190
|
|
21126
|
-
raf.supported =
|
21191
|
+
raf.supported = rafSupported;
|
21127
21192
|
|
21128
21193
|
return raf;
|
21129
21194
|
}];
|
@@ -21268,7 +21333,6 @@ function $RootScopeProvider(){
|
|
21268
21333
|
/**
|
21269
21334
|
* @ngdoc property
|
21270
21335
|
* @name $rootScope.Scope#$id
|
21271
|
-
* @propertyOf ng.$rootScope.Scope
|
21272
21336
|
* @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for
|
21273
21337
|
* debugging.
|
21274
21338
|
*/
|
@@ -21528,30 +21592,40 @@ function $RootScopeProvider(){
|
|
21528
21592
|
* {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
|
21529
21593
|
* collection will trigger a call to the `listener`.
|
21530
21594
|
*
|
21531
|
-
* @param {function(newCollection, oldCollection, scope)} listener a callback function
|
21532
|
-
*
|
21533
|
-
* The `newCollection` object is the newly modified data obtained from the `obj` expression
|
21534
|
-
*
|
21535
|
-
*
|
21595
|
+
* @param {function(newCollection, oldCollection, scope)} listener a callback function called
|
21596
|
+
* when a change is detected.
|
21597
|
+
* - The `newCollection` object is the newly modified data obtained from the `obj` expression
|
21598
|
+
* - The `oldCollection` object is a copy of the former collection data.
|
21599
|
+
* Due to performance considerations, the`oldCollection` value is computed only if the
|
21600
|
+
* `listener` function declares two or more arguments.
|
21601
|
+
* - The `scope` argument refers to the current scope.
|
21536
21602
|
*
|
21537
21603
|
* @returns {function()} Returns a de-registration function for this listener. When the
|
21538
21604
|
* de-registration function is executed, the internal watch operation is terminated.
|
21539
21605
|
*/
|
21540
21606
|
$watchCollection: function(obj, listener) {
|
21541
21607
|
var self = this;
|
21542
|
-
|
21608
|
+
// the current value, updated on each dirty-check run
|
21543
21609
|
var newValue;
|
21610
|
+
// a shallow copy of the newValue from the last dirty-check run,
|
21611
|
+
// updated to match newValue during dirty-check run
|
21612
|
+
var oldValue;
|
21613
|
+
// a shallow copy of the newValue from when the last change happened
|
21614
|
+
var veryOldValue;
|
21615
|
+
// only track veryOldValue if the listener is asking for it
|
21616
|
+
var trackVeryOldValue = (listener.length > 1);
|
21544
21617
|
var changeDetected = 0;
|
21545
21618
|
var objGetter = $parse(obj);
|
21546
21619
|
var internalArray = [];
|
21547
21620
|
var internalObject = {};
|
21621
|
+
var initRun = true;
|
21548
21622
|
var oldLength = 0;
|
21549
21623
|
|
21550
21624
|
function $watchCollectionWatch() {
|
21551
21625
|
newValue = objGetter(self);
|
21552
21626
|
var newLength, key;
|
21553
21627
|
|
21554
|
-
if (!isObject(newValue)) {
|
21628
|
+
if (!isObject(newValue)) { // if primitive
|
21555
21629
|
if (oldValue !== newValue) {
|
21556
21630
|
oldValue = newValue;
|
21557
21631
|
changeDetected++;
|
@@ -21573,7 +21647,9 @@ function $RootScopeProvider(){
|
|
21573
21647
|
}
|
21574
21648
|
// copy the items to oldValue and look for changes.
|
21575
21649
|
for (var i = 0; i < newLength; i++) {
|
21576
|
-
|
21650
|
+
var bothNaN = (oldValue[i] !== oldValue[i]) &&
|
21651
|
+
(newValue[i] !== newValue[i]);
|
21652
|
+
if (!bothNaN && (oldValue[i] !== newValue[i])) {
|
21577
21653
|
changeDetected++;
|
21578
21654
|
oldValue[i] = newValue[i];
|
21579
21655
|
}
|
@@ -21617,7 +21693,32 @@ function $RootScopeProvider(){
|
|
21617
21693
|
}
|
21618
21694
|
|
21619
21695
|
function $watchCollectionAction() {
|
21620
|
-
|
21696
|
+
if (initRun) {
|
21697
|
+
initRun = false;
|
21698
|
+
listener(newValue, newValue, self);
|
21699
|
+
} else {
|
21700
|
+
listener(newValue, veryOldValue, self);
|
21701
|
+
}
|
21702
|
+
|
21703
|
+
// make a copy for the next time a collection is changed
|
21704
|
+
if (trackVeryOldValue) {
|
21705
|
+
if (!isObject(newValue)) {
|
21706
|
+
//primitive
|
21707
|
+
veryOldValue = newValue;
|
21708
|
+
} else if (isArrayLike(newValue)) {
|
21709
|
+
veryOldValue = new Array(newValue.length);
|
21710
|
+
for (var i = 0; i < newValue.length; i++) {
|
21711
|
+
veryOldValue[i] = newValue[i];
|
21712
|
+
}
|
21713
|
+
} else { // if object
|
21714
|
+
veryOldValue = {};
|
21715
|
+
for (var key in newValue) {
|
21716
|
+
if (hasOwnProperty.call(newValue, key)) {
|
21717
|
+
veryOldValue[key] = newValue[key];
|
21718
|
+
}
|
21719
|
+
}
|
21720
|
+
}
|
21721
|
+
}
|
21621
21722
|
}
|
21622
21723
|
|
21623
21724
|
return this.$watch($watchCollectionWatch, $watchCollectionAction);
|
@@ -21781,7 +21882,6 @@ function $RootScopeProvider(){
|
|
21781
21882
|
/**
|
21782
21883
|
* @ngdoc event
|
21783
21884
|
* @name $rootScope.Scope#$destroy
|
21784
|
-
* @eventOf ng.$rootScope.Scope
|
21785
21885
|
* @eventType broadcast on scope being destroyed
|
21786
21886
|
*
|
21787
21887
|
* @description
|
@@ -21999,7 +22099,7 @@ function $RootScopeProvider(){
|
|
21999
22099
|
* - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
|
22000
22100
|
*
|
22001
22101
|
* @param {string} name Event name to listen on.
|
22002
|
-
* @param {function(event, args
|
22102
|
+
* @param {function(event, ...args)} listener Function to call when the event is emitted.
|
22003
22103
|
* @returns {function()} Returns a deregistration function for this listener.
|
22004
22104
|
*/
|
22005
22105
|
$on: function(name, listener) {
|
@@ -22800,7 +22900,7 @@ function $SceDelegateProvider() {
|
|
22800
22900
|
* |---------------------|----------------|
|
22801
22901
|
* | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. |
|
22802
22902
|
* | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |
|
22803
|
-
* | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`<a href=` and `<img src=` sanitize their urls and don't
|
22903
|
+
* | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`<a href=` and `<img src=` sanitize their urls and don't constitute an SCE context. |
|
22804
22904
|
* | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contens are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.) <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |
|
22805
22905
|
* | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |
|
22806
22906
|
*
|
@@ -24447,7 +24547,7 @@ function dateFilter($locale) {
|
|
24447
24547
|
* @returns {string} JSON string.
|
24448
24548
|
*
|
24449
24549
|
*
|
24450
|
-
* @example
|
24550
|
+
* @example
|
24451
24551
|
<example>
|
24452
24552
|
<file name="index.html">
|
24453
24553
|
<pre>{{ {'name':'value'} | json }}</pre>
|
@@ -24671,6 +24771,12 @@ function orderByFilter($parse){
|
|
24671
24771
|
predicate = predicate.substring(1);
|
24672
24772
|
}
|
24673
24773
|
get = $parse(predicate);
|
24774
|
+
if (get.constant) {
|
24775
|
+
var key = get();
|
24776
|
+
return reverseComparator(function(a,b) {
|
24777
|
+
return compare(a[key], b[key]);
|
24778
|
+
}, descending);
|
24779
|
+
}
|
24674
24780
|
}
|
24675
24781
|
return reverseComparator(function(a,b){
|
24676
24782
|
return compare(get(a),get(b));
|
@@ -25044,7 +25150,7 @@ var htmlAnchorDirective = valueFn({
|
|
25044
25150
|
* such as selected. (Their presence means true and their absence means false.)
|
25045
25151
|
* If we put an Angular interpolation expression into such an attribute then the
|
25046
25152
|
* binding information would be lost when the browser removes the attribute.
|
25047
|
-
* The `ngSelected` directive solves this problem for the `selected`
|
25153
|
+
* The `ngSelected` directive solves this problem for the `selected` attribute.
|
25048
25154
|
* This complementary directive is not removed by the browser and so provides
|
25049
25155
|
* a permanent reliable place to store the binding information.
|
25050
25156
|
*
|
@@ -25523,8 +25629,6 @@ function FormController(element, attrs, $scope, $animate) {
|
|
25523
25629
|
</file>
|
25524
25630
|
</example>
|
25525
25631
|
*
|
25526
|
-
* @param {string=} name Name of the form. If specified, the form controller will be published into
|
25527
|
-
* related scope, under this name.
|
25528
25632
|
*/
|
25529
25633
|
var formDirectiveFactory = function(isNgForm) {
|
25530
25634
|
return ['$timeout', function($timeout) {
|
@@ -27192,7 +27296,7 @@ var ngValueDirective = function() {
|
|
27192
27296
|
* Typically, you don't use `ngBind` directly, but instead you use the double curly markup like
|
27193
27297
|
* `{{ expression }}` which is similar but less verbose.
|
27194
27298
|
*
|
27195
|
-
* It is
|
27299
|
+
* It is preferable to use `ngBind` instead of `{{ expression }}` when a template is momentarily
|
27196
27300
|
* displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an
|
27197
27301
|
* element attribute, it makes the bindings invisible to the user while the page is loading.
|
27198
27302
|
*
|
@@ -28564,7 +28668,7 @@ var ngIfDirective = ['$animate', function($animate) {
|
|
28564
28668
|
* @priority 400
|
28565
28669
|
*
|
28566
28670
|
* @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,
|
28567
|
-
* make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`.
|
28671
|
+
* make sure you wrap it in **single** quotes, e.g. `src="'myPartialTemplate.html'"`.
|
28568
28672
|
* @param {string=} onload Expression to evaluate when a new partial is loaded.
|
28569
28673
|
*
|
28570
28674
|
* @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll
|
@@ -28678,7 +28782,6 @@ var ngIfDirective = ['$animate', function($animate) {
|
|
28678
28782
|
/**
|
28679
28783
|
* @ngdoc event
|
28680
28784
|
* @name ngInclude#$includeContentRequested
|
28681
|
-
* @eventOf ng.directive:ngInclude
|
28682
28785
|
* @eventType emit on the scope ngInclude was declared in
|
28683
28786
|
* @description
|
28684
28787
|
* Emitted every time the ngInclude content is requested.
|
@@ -28688,7 +28791,6 @@ var ngIfDirective = ['$animate', function($animate) {
|
|
28688
28791
|
/**
|
28689
28792
|
* @ngdoc event
|
28690
28793
|
* @name ngInclude#$includeContentLoaded
|
28691
|
-
* @eventOf ng.directive:ngInclude
|
28692
28794
|
* @eventType emit on the current ngInclude scope
|
28693
28795
|
* @description
|
28694
28796
|
* Emitted every time the ngInclude content is reloaded.
|
@@ -29175,9 +29277,11 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
|
|
29175
29277
|
* as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
|
29176
29278
|
*
|
29177
29279
|
* @animations
|
29178
|
-
* enter - when a new item is added to the list or when an item is revealed after a filter
|
29179
|
-
*
|
29180
|
-
*
|
29280
|
+
* **.enter** - when a new item is added to the list or when an item is revealed after a filter
|
29281
|
+
*
|
29282
|
+
* **.leave** - when an item is removed from the list or when an item is filtered out
|
29283
|
+
*
|
29284
|
+
* **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
|
29181
29285
|
*
|
29182
29286
|
* @element ANY
|
29183
29287
|
* @scope
|
@@ -29909,7 +30013,6 @@ var ngStyleDirective = ngDirective(function(scope, element, attr) {
|
|
29909
30013
|
* @scope
|
29910
30014
|
* @priority 800
|
29911
30015
|
* @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.
|
29912
|
-
* @paramDescription
|
29913
30016
|
* On child elements add:
|
29914
30017
|
*
|
29915
30018
|
* * `ngSwitchWhen`: the case statement to match against. If match then this
|
@@ -30158,7 +30261,7 @@ var ngTranscludeDirective = ngDirective({
|
|
30158
30261
|
* `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
|
30159
30262
|
* assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
|
30160
30263
|
*
|
30161
|
-
* @param {
|
30264
|
+
* @param {string} type Must be set to `'text/ng-template'`.
|
30162
30265
|
* @param {string} id Cache name of the template.
|
30163
30266
|
*
|
30164
30267
|
* @example
|
@@ -30589,6 +30692,12 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
30589
30692
|
value = valueFn(scope, locals);
|
30590
30693
|
}
|
30591
30694
|
}
|
30695
|
+
// Update the null option's selected property here so $render cleans it up correctly
|
30696
|
+
if (optionGroupsCache[0].length > 1) {
|
30697
|
+
if (optionGroupsCache[0][1].id !== key) {
|
30698
|
+
optionGroupsCache[0][1].selected = false;
|
30699
|
+
}
|
30700
|
+
}
|
30592
30701
|
}
|
30593
30702
|
ctrl.$setViewValue(value);
|
30594
30703
|
});
|
@@ -30726,7 +30835,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
|
|
30726
30835
|
lastElement.val(existingOption.id = option.id);
|
30727
30836
|
}
|
30728
30837
|
// lastElement.prop('selected') provided by jQuery has side-effects
|
30729
|
-
if (
|
30838
|
+
if (existingOption.selected !== option.selected) {
|
30730
30839
|
lastElement.prop('selected', (existingOption.selected = option.selected));
|
30731
30840
|
}
|
30732
30841
|
} else {
|