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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.14
2
+ * @license AngularJS v1.2.15
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -215,6 +215,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
215
215
  var ACTIVE_CLASS_NAME = 'ng-click-active';
216
216
  var lastPreventedTime;
217
217
  var touchCoordinates;
218
+ var lastLabelClickCoordinates;
218
219
 
219
220
 
220
221
  // TAP EVENTS AND GHOST CLICKS
@@ -286,10 +287,23 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
286
287
  var y = touches[0].clientY;
287
288
  // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label
288
289
  // and on the input element). Depending on the exact browser, this second click we don't want
289
- // to bust has either (0,0) or negative coordinates.
290
+ // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label
291
+ // click event
290
292
  if (x < 1 && y < 1) {
291
293
  return; // offscreen
292
294
  }
295
+ if (lastLabelClickCoordinates &&
296
+ lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {
297
+ return; // input click triggered by label click
298
+ }
299
+ // reset label click coordinates on first subsequent click
300
+ if (lastLabelClickCoordinates) {
301
+ lastLabelClickCoordinates = null;
302
+ }
303
+ // remember label click coordinates to prevent click busting of trigger click event on input
304
+ if (event.target.tagName.toLowerCase() === 'label') {
305
+ lastLabelClickCoordinates = [x, y];
306
+ }
293
307
 
294
308
  // Look for an allowable region containing this click.
295
309
  // If we find one, that means it was created by touchstart and not removed by
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.14
2
+ * @license AngularJS v1.2.15
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -68,7 +68,7 @@ function minErr(module) {
68
68
  return match;
69
69
  });
70
70
 
71
- message = message + '\nhttp://errors.angularjs.org/1.2.14/' +
71
+ message = message + '\nhttp://errors.angularjs.org/1.2.15/' +
72
72
  (module ? module + '/' : '') + code;
73
73
  for (i = 2; i < arguments.length; i++) {
74
74
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -124,6 +124,7 @@ function minErr(module) {
124
124
  -isWindow,
125
125
  -isScope,
126
126
  -isFile,
127
+ -isBlob,
127
128
  -isBoolean,
128
129
  -trim,
129
130
  -isElement,
@@ -645,6 +646,11 @@ function isFile(obj) {
645
646
  }
646
647
 
647
648
 
649
+ function isBlob(obj) {
650
+ return toString.call(obj) === '[object Blob]';
651
+ }
652
+
653
+
648
654
  function isBoolean(value) {
649
655
  return typeof value === 'boolean';
650
656
  }
@@ -1314,6 +1320,41 @@ function angularInit(element, bootstrap) {
1314
1320
  * Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually.
1315
1321
  * They must use {@link ng.directive:ngApp ngApp}.
1316
1322
  *
1323
+ * Angular will detect if it has been loaded into the browser more than once and only allow the
1324
+ * first loaded script to be bootstrapped and will report a warning to the browser console for
1325
+ * each of the subsequent scripts. This prevents strange results in applications, where otherwise
1326
+ * multiple instances of Angular try to work on the DOM.
1327
+ *
1328
+ * <example name="multi-bootstrap" module="multi-bootstrap">
1329
+ * <file name="index.html">
1330
+ * <script src="../../../angular.js"></script>
1331
+ * <div ng-controller="BrokenTable">
1332
+ * <table>
1333
+ * <tr>
1334
+ * <th ng-repeat="heading in headings">{{heading}}</th>
1335
+ * </tr>
1336
+ * <tr ng-repeat="filling in fillings">
1337
+ * <td ng-repeat="fill in filling">{{fill}}</td>
1338
+ * </tr>
1339
+ * </table>
1340
+ * </div>
1341
+ * </file>
1342
+ * <file name="controller.js">
1343
+ * var app = angular.module('multi-bootstrap', [])
1344
+ *
1345
+ * .controller('BrokenTable', function($scope) {
1346
+ * $scope.headings = ['One', 'Two', 'Three'];
1347
+ * $scope.fillings = [[1, 2, 3], ['A', 'B', 'C'], [7, 8, 9]];
1348
+ * });
1349
+ * </file>
1350
+ * <file name="protractor.js" type="protractor">
1351
+ * it('should only insert one table cell for each item in $scope.fillings', function() {
1352
+ * expect(element.all(by.css('td')).count())
1353
+ * .toBe(9);
1354
+ * });
1355
+ * </file>
1356
+ * </example>
1357
+ *
1317
1358
  * @param {Element} element DOM element which is the root of angular application.
1318
1359
  * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.
1319
1360
  * Each item in the array should be the name of a predefined module or a (DI annotated)
@@ -1531,16 +1572,16 @@ function setupModuleLoader(window) {
1531
1572
  * myModule.value('appName', 'MyCoolApp');
1532
1573
  *
1533
1574
  * // configure existing services inside initialization blocks.
1534
- * myModule.config(function($locationProvider) {
1575
+ * myModule.config(['$locationProvider', function($locationProvider) {
1535
1576
  * // Configure existing providers
1536
1577
  * $locationProvider.hashPrefix('!');
1537
- * });
1578
+ * }]);
1538
1579
  * ```
1539
1580
  *
1540
1581
  * Then you can create an injector and load your modules like this:
1541
1582
  *
1542
1583
  * ```js
1543
- * var injector = angular.injector(['ng', 'MyModule'])
1584
+ * var injector = angular.injector(['ng', 'myModule'])
1544
1585
  * ```
1545
1586
  *
1546
1587
  * However it's more likely that you'll just use
@@ -1549,7 +1590,7 @@ function setupModuleLoader(window) {
1549
1590
  *
1550
1591
  * @param {!string} name The name of the module to create or retrieve.
1551
1592
  * @param {Array.<string>=} requires If specified then new module is being created. If
1552
- * unspecified then the the module is being retrieved for further configuration.
1593
+ * unspecified then the module is being retrieved for further configuration.
1553
1594
  * @param {Function} configFn Optional configuration function for the module. Same as
1554
1595
  * {@link angular.Module#config Module#config()}.
1555
1596
  * @returns {module} new module with the {@link angular.Module} api.
@@ -1590,7 +1631,6 @@ function setupModuleLoader(window) {
1590
1631
  * @ngdoc property
1591
1632
  * @name angular.Module#requires
1592
1633
  * @module ng
1593
- * @propertyOf angular.Module
1594
1634
  * @returns {Array.<string>} List of module names which must be loaded before this module.
1595
1635
  * @description
1596
1636
  * Holds the list of modules which the injector will load before the current module is
@@ -1602,7 +1642,6 @@ function setupModuleLoader(window) {
1602
1642
  * @ngdoc property
1603
1643
  * @name angular.Module#name
1604
1644
  * @module ng
1605
- * @propertyOf angular.Module
1606
1645
  * @returns {string} Name of the module.
1607
1646
  * @description
1608
1647
  */
@@ -1880,11 +1919,11 @@ function setupModuleLoader(window) {
1880
1919
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
1881
1920
  */
1882
1921
  var version = {
1883
- full: '1.2.14', // all of these placeholder strings will be replaced by grunt's
1922
+ full: '1.2.15', // all of these placeholder strings will be replaced by grunt's
1884
1923
  major: 1, // package task
1885
1924
  minor: 2,
1886
- dot: 14,
1887
- codeName: 'feisty-cryokinesis'
1925
+ dot: 15,
1926
+ codeName: 'beer-underestimating'
1888
1927
  };
1889
1928
 
1890
1929
 
@@ -2372,11 +2411,15 @@ function jqLiteInheritedData(element, name, value) {
2372
2411
  var names = isArray(name) ? name : [name];
2373
2412
 
2374
2413
  while (element.length) {
2375
-
2414
+ var node = element[0];
2376
2415
  for (var i = 0, ii = names.length; i < ii; i++) {
2377
2416
  if ((value = element.data(names[i])) !== undefined) return value;
2378
2417
  }
2379
- element = element.parent();
2418
+
2419
+ // If dealing with a document fragment node with a host element, and no parent, use the host
2420
+ // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
2421
+ // to lookup parent controllers.
2422
+ element = jqLite(node.parentNode || (node.nodeType === 11 && node.host));
2380
2423
  }
2381
2424
  }
2382
2425
 
@@ -2465,7 +2508,7 @@ forEach({
2465
2508
  return jqLite(element).data('$isolateScope') || jqLite(element).data('$isolateScopeNoTemplate');
2466
2509
  },
2467
2510
 
2468
- controller: jqLiteController ,
2511
+ controller: jqLiteController,
2469
2512
 
2470
2513
  injector: function(element) {
2471
2514
  return jqLiteInheritedData(element, '$injector');
@@ -4338,7 +4381,6 @@ function Browser(window, document, $log, $sniffer) {
4338
4381
 
4339
4382
  /**
4340
4383
  * @name $browser#onUrlChange
4341
- * @TODO(vojta): refactor to use node's syntax for events
4342
4384
  *
4343
4385
  * @description
4344
4386
  * Register callback function that will be called, when url changes.
@@ -4359,6 +4401,7 @@ function Browser(window, document, $log, $sniffer) {
4359
4401
  * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
4360
4402
  */
4361
4403
  self.onUrlChange = function(callback) {
4404
+ // TODO(vojta): refactor to use node's syntax for events
4362
4405
  if (!urlChangeInit) {
4363
4406
  // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
4364
4407
  // don't fire popstate when user change the address bar and don't fire hashchange when url
@@ -4735,15 +4778,11 @@ function $CacheFactoryProvider() {
4735
4778
  * `$templateCache` service directly.
4736
4779
  *
4737
4780
  * Adding via the `script` tag:
4781
+ *
4738
4782
  * ```html
4739
- * <html ng-app>
4740
- * <head>
4741
- * <script type="text/ng-template" id="templateId.html">
4742
- * This is the content of the template
4743
- * </script>
4744
- * </head>
4745
- * ...
4746
- * </html>
4783
+ * <script type="text/ng-template" id="templateId.html">
4784
+ * <p>This is the content of the template</p>
4785
+ * </script>
4747
4786
  * ```
4748
4787
  *
4749
4788
  * **Note:** the `script` tag containing the template does not need to be included in the `head` of
@@ -5280,7 +5319,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
5280
5319
  Suffix = 'Directive',
5281
5320
  COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
5282
5321
  CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
5283
- TABLE_CONTENT_REGEXP = /^<\s*(tr|th|td|tbody)(\s+[^>]*)?>/i;
5322
+ TABLE_CONTENT_REGEXP = /^<\s*(tr|th|td|thead|tbody|tfoot)(\s+[^>]*)?>/i;
5284
5323
 
5285
5324
  // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes
5286
5325
  // The assumption is that future DOM event attribute names will begin with
@@ -6426,16 +6465,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
6426
6465
  template = trim(template);
6427
6466
  if ((type = TABLE_CONTENT_REGEXP.exec(template))) {
6428
6467
  type = type[1].toLowerCase();
6429
- var table = jqLite('<table>' + template + '</table>'),
6430
- tbody = table.children('tbody'),
6431
- leaf = /(td|th)/.test(type) && table.find('tr');
6432
- if (tbody.length && type !== 'tbody') {
6433
- table = tbody;
6468
+ var table = jqLite('<table>' + template + '</table>');
6469
+ if (/(thead|tbody|tfoot)/.test(type)) {
6470
+ return table.children(type);
6434
6471
  }
6435
- if (leaf && leaf.length) {
6436
- table = leaf;
6472
+ table = table.children('tbody');
6473
+ if (type === 'tr') {
6474
+ return table.children('tr');
6437
6475
  }
6438
- return table.contents();
6476
+ return table.children('tr').contents();
6439
6477
  }
6440
6478
  return jqLite('<div>' +
6441
6479
  template +
@@ -6905,6 +6943,22 @@ function $ControllerProvider() {
6905
6943
  *
6906
6944
  * @description
6907
6945
  * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
6946
+ *
6947
+ * @example
6948
+ <example>
6949
+ <file name="index.html">
6950
+ <div ng-controller="MainCtrl">
6951
+ <p>$document title: <b ng-bind="title"></b></p>
6952
+ <p>window.document title: <b ng-bind="windowTitle"></b></p>
6953
+ </div>
6954
+ </file>
6955
+ <file name="script.js">
6956
+ function MainCtrl($scope, $document) {
6957
+ $scope.title = $document[0].title;
6958
+ $scope.windowTitle = angular.element(window.document)[0].title;
6959
+ }
6960
+ </file>
6961
+ </example>
6908
6962
  */
6909
6963
  function $DocumentProvider(){
6910
6964
  this.$get = ['$window', function(window){
@@ -7055,7 +7109,7 @@ function $HttpProvider() {
7055
7109
 
7056
7110
  // transform outgoing request data
7057
7111
  transformRequest: [function(d) {
7058
- return isObject(d) && !isFile(d) ? toJson(d) : d;
7112
+ return isObject(d) && !isFile(d) && !isBlob(d) ? toJson(d) : d;
7059
7113
  }],
7060
7114
 
7061
7115
  // default headers
@@ -7188,9 +7242,8 @@ function $HttpProvider() {
7188
7242
  *
7189
7243
  * # Shortcut methods
7190
7244
  *
7191
- * Since all invocations of the $http service require passing in an HTTP method and URL, and
7192
- * POST/PUT requests require request data to be provided as well, shortcut methods
7193
- * were created:
7245
+ * Shortcut methods are also available. All shortcut methods require passing in the URL, and
7246
+ * request data must be passed in for POST/PUT requests.
7194
7247
  *
7195
7248
  * ```js
7196
7249
  * $http.get('/someUrl').success(successCallback);
@@ -7525,7 +7578,7 @@ function $HttpProvider() {
7525
7578
  * - **headers** – `{function([headerName])}` – Header getter function.
7526
7579
  * - **config** – `{Object}` – The configuration object that was used to generate the request.
7527
7580
  *
7528
- * @property {Array.&ltObject&gt;} pendingRequests Array of config objects for currently pending
7581
+ * @property {Array.<Object>} pendingRequests Array of config objects for currently pending
7529
7582
  * requests. This is primarily meant to be used for debugging purposes.
7530
7583
  *
7531
7584
  *
@@ -7827,7 +7880,6 @@ function $HttpProvider() {
7827
7880
  /**
7828
7881
  * @ngdoc property
7829
7882
  * @name $http#defaults
7830
- * @propertyOf ng.$http
7831
7883
  *
7832
7884
  * @description
7833
7885
  * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of
@@ -8132,9 +8184,11 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
8132
8184
  jsonpDone = xhr = null;
8133
8185
 
8134
8186
  // fix status code when it is 0 (0 status is undocumented).
8135
- // Occurs when accessing file resources.
8136
- // On Android 4.1 stock browser it occurs while retrieving files from application cache.
8137
- status = (status === 0) ? (response ? 200 : 404) : status;
8187
+ // Occurs when accessing file resources or on Android 4.1 stock browser
8188
+ // while retrieving files from application cache.
8189
+ if (status === 0) {
8190
+ status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;
8191
+ }
8138
8192
 
8139
8193
  // normalize IE bug (http://bugs.jquery.com/ticket/1450)
8140
8194
  status = status == 1223 ? 204 : status;
@@ -8578,7 +8632,7 @@ function $IntervalProvider() {
8578
8632
  * @description
8579
8633
  * Cancels a task associated with the `promise`.
8580
8634
  *
8581
- * @param {number} promise Promise returned by the `$interval` function.
8635
+ * @param {promise} promise returned by the `$interval` function.
8582
8636
  * @returns {boolean} Returns `true` if the task was successfully canceled.
8583
8637
  */
8584
8638
  interval.cancel = function(promise) {
@@ -10904,7 +10958,7 @@ function $ParseProvider() {
10904
10958
  *
10905
10959
  * Because `finally` is a reserved word in JavaScript and reserved keywords are not supported as
10906
10960
  * property names by ES3, you'll need to invoke the method like `promise['finally'](callback)` to
10907
- * make your code IE8 compatible.
10961
+ * make your code IE8 and Android 2.x compatible.
10908
10962
  *
10909
10963
  * # Chaining promises
10910
10964
  *
@@ -11317,21 +11371,32 @@ function qFactory(nextTick, exceptionHandler) {
11317
11371
  }
11318
11372
 
11319
11373
  function $$RAFProvider(){ //rAF
11320
- this.$get = ['$window', function($window) {
11374
+ this.$get = ['$window', '$timeout', function($window, $timeout) {
11321
11375
  var requestAnimationFrame = $window.requestAnimationFrame ||
11322
- $window.webkitRequestAnimationFrame;
11376
+ $window.webkitRequestAnimationFrame ||
11377
+ $window.mozRequestAnimationFrame;
11323
11378
 
11324
11379
  var cancelAnimationFrame = $window.cancelAnimationFrame ||
11325
- $window.webkitCancelAnimationFrame;
11326
-
11327
- var raf = function(fn) {
11328
- var id = requestAnimationFrame(fn);
11329
- return function() {
11330
- cancelAnimationFrame(id);
11331
- };
11332
- };
11380
+ $window.webkitCancelAnimationFrame ||
11381
+ $window.mozCancelAnimationFrame ||
11382
+ $window.webkitCancelRequestAnimationFrame;
11383
+
11384
+ var rafSupported = !!requestAnimationFrame;
11385
+ var raf = rafSupported
11386
+ ? function(fn) {
11387
+ var id = requestAnimationFrame(fn);
11388
+ return function() {
11389
+ cancelAnimationFrame(id);
11390
+ };
11391
+ }
11392
+ : function(fn) {
11393
+ var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666
11394
+ return function() {
11395
+ $timeout.cancel(timer);
11396
+ };
11397
+ };
11333
11398
 
11334
- raf.supported = !!requestAnimationFrame;
11399
+ raf.supported = rafSupported;
11335
11400
 
11336
11401
  return raf;
11337
11402
  }];
@@ -11476,7 +11541,6 @@ function $RootScopeProvider(){
11476
11541
  /**
11477
11542
  * @ngdoc property
11478
11543
  * @name $rootScope.Scope#$id
11479
- * @propertyOf ng.$rootScope.Scope
11480
11544
  * @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for
11481
11545
  * debugging.
11482
11546
  */
@@ -11736,30 +11800,40 @@ function $RootScopeProvider(){
11736
11800
  * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
11737
11801
  * collection will trigger a call to the `listener`.
11738
11802
  *
11739
- * @param {function(newCollection, oldCollection, scope)} listener a callback function that is
11740
- * fired with both the `newCollection` and `oldCollection` as parameters.
11741
- * The `newCollection` object is the newly modified data obtained from the `obj` expression
11742
- * and the `oldCollection` object is a copy of the former collection data.
11743
- * The `scope` refers to the current scope.
11803
+ * @param {function(newCollection, oldCollection, scope)} listener a callback function called
11804
+ * when a change is detected.
11805
+ * - The `newCollection` object is the newly modified data obtained from the `obj` expression
11806
+ * - The `oldCollection` object is a copy of the former collection data.
11807
+ * Due to performance considerations, the`oldCollection` value is computed only if the
11808
+ * `listener` function declares two or more arguments.
11809
+ * - The `scope` argument refers to the current scope.
11744
11810
  *
11745
11811
  * @returns {function()} Returns a de-registration function for this listener. When the
11746
11812
  * de-registration function is executed, the internal watch operation is terminated.
11747
11813
  */
11748
11814
  $watchCollection: function(obj, listener) {
11749
11815
  var self = this;
11750
- var oldValue;
11816
+ // the current value, updated on each dirty-check run
11751
11817
  var newValue;
11818
+ // a shallow copy of the newValue from the last dirty-check run,
11819
+ // updated to match newValue during dirty-check run
11820
+ var oldValue;
11821
+ // a shallow copy of the newValue from when the last change happened
11822
+ var veryOldValue;
11823
+ // only track veryOldValue if the listener is asking for it
11824
+ var trackVeryOldValue = (listener.length > 1);
11752
11825
  var changeDetected = 0;
11753
11826
  var objGetter = $parse(obj);
11754
11827
  var internalArray = [];
11755
11828
  var internalObject = {};
11829
+ var initRun = true;
11756
11830
  var oldLength = 0;
11757
11831
 
11758
11832
  function $watchCollectionWatch() {
11759
11833
  newValue = objGetter(self);
11760
11834
  var newLength, key;
11761
11835
 
11762
- if (!isObject(newValue)) {
11836
+ if (!isObject(newValue)) { // if primitive
11763
11837
  if (oldValue !== newValue) {
11764
11838
  oldValue = newValue;
11765
11839
  changeDetected++;
@@ -11781,7 +11855,9 @@ function $RootScopeProvider(){
11781
11855
  }
11782
11856
  // copy the items to oldValue and look for changes.
11783
11857
  for (var i = 0; i < newLength; i++) {
11784
- if (oldValue[i] !== newValue[i]) {
11858
+ var bothNaN = (oldValue[i] !== oldValue[i]) &&
11859
+ (newValue[i] !== newValue[i]);
11860
+ if (!bothNaN && (oldValue[i] !== newValue[i])) {
11785
11861
  changeDetected++;
11786
11862
  oldValue[i] = newValue[i];
11787
11863
  }
@@ -11825,7 +11901,32 @@ function $RootScopeProvider(){
11825
11901
  }
11826
11902
 
11827
11903
  function $watchCollectionAction() {
11828
- listener(newValue, oldValue, self);
11904
+ if (initRun) {
11905
+ initRun = false;
11906
+ listener(newValue, newValue, self);
11907
+ } else {
11908
+ listener(newValue, veryOldValue, self);
11909
+ }
11910
+
11911
+ // make a copy for the next time a collection is changed
11912
+ if (trackVeryOldValue) {
11913
+ if (!isObject(newValue)) {
11914
+ //primitive
11915
+ veryOldValue = newValue;
11916
+ } else if (isArrayLike(newValue)) {
11917
+ veryOldValue = new Array(newValue.length);
11918
+ for (var i = 0; i < newValue.length; i++) {
11919
+ veryOldValue[i] = newValue[i];
11920
+ }
11921
+ } else { // if object
11922
+ veryOldValue = {};
11923
+ for (var key in newValue) {
11924
+ if (hasOwnProperty.call(newValue, key)) {
11925
+ veryOldValue[key] = newValue[key];
11926
+ }
11927
+ }
11928
+ }
11929
+ }
11829
11930
  }
11830
11931
 
11831
11932
  return this.$watch($watchCollectionWatch, $watchCollectionAction);
@@ -11989,7 +12090,6 @@ function $RootScopeProvider(){
11989
12090
  /**
11990
12091
  * @ngdoc event
11991
12092
  * @name $rootScope.Scope#$destroy
11992
- * @eventOf ng.$rootScope.Scope
11993
12093
  * @eventType broadcast on scope being destroyed
11994
12094
  *
11995
12095
  * @description
@@ -12207,7 +12307,7 @@ function $RootScopeProvider(){
12207
12307
  * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
12208
12308
  *
12209
12309
  * @param {string} name Event name to listen on.
12210
- * @param {function(event, args...)} listener Function to call when the event is emitted.
12310
+ * @param {function(event, ...args)} listener Function to call when the event is emitted.
12211
12311
  * @returns {function()} Returns a deregistration function for this listener.
12212
12312
  */
12213
12313
  $on: function(name, listener) {
@@ -13008,7 +13108,7 @@ function $SceDelegateProvider() {
13008
13108
  * |---------------------|----------------|
13009
13109
  * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. |
13010
13110
  * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |
13011
- * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`<a href=` and `<img src=` sanitize their urls and don't consititute an SCE context. |
13111
+ * | `$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. |
13012
13112
  * | `$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. |
13013
13113
  * | `$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. |
13014
13114
  *
@@ -14655,7 +14755,7 @@ function dateFilter($locale) {
14655
14755
  * @returns {string} JSON string.
14656
14756
  *
14657
14757
  *
14658
- * @example:
14758
+ * @example
14659
14759
  <example>
14660
14760
  <file name="index.html">
14661
14761
  <pre>{{ {'name':'value'} | json }}</pre>
@@ -14879,6 +14979,12 @@ function orderByFilter($parse){
14879
14979
  predicate = predicate.substring(1);
14880
14980
  }
14881
14981
  get = $parse(predicate);
14982
+ if (get.constant) {
14983
+ var key = get();
14984
+ return reverseComparator(function(a,b) {
14985
+ return compare(a[key], b[key]);
14986
+ }, descending);
14987
+ }
14882
14988
  }
14883
14989
  return reverseComparator(function(a,b){
14884
14990
  return compare(get(a),get(b));
@@ -15252,7 +15358,7 @@ var htmlAnchorDirective = valueFn({
15252
15358
  * such as selected. (Their presence means true and their absence means false.)
15253
15359
  * If we put an Angular interpolation expression into such an attribute then the
15254
15360
  * binding information would be lost when the browser removes the attribute.
15255
- * The `ngSelected` directive solves this problem for the `selected` atttribute.
15361
+ * The `ngSelected` directive solves this problem for the `selected` attribute.
15256
15362
  * This complementary directive is not removed by the browser and so provides
15257
15363
  * a permanent reliable place to store the binding information.
15258
15364
  *
@@ -15731,8 +15837,6 @@ function FormController(element, attrs, $scope, $animate) {
15731
15837
  </file>
15732
15838
  </example>
15733
15839
  *
15734
- * @param {string=} name Name of the form. If specified, the form controller will be published into
15735
- * related scope, under this name.
15736
15840
  */
15737
15841
  var formDirectiveFactory = function(isNgForm) {
15738
15842
  return ['$timeout', function($timeout) {
@@ -17400,7 +17504,7 @@ var ngValueDirective = function() {
17400
17504
  * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like
17401
17505
  * `{{ expression }}` which is similar but less verbose.
17402
17506
  *
17403
- * It is preferrable to use `ngBind` instead of `{{ expression }}` when a template is momentarily
17507
+ * It is preferable to use `ngBind` instead of `{{ expression }}` when a template is momentarily
17404
17508
  * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an
17405
17509
  * element attribute, it makes the bindings invisible to the user while the page is loading.
17406
17510
  *
@@ -18772,7 +18876,7 @@ var ngIfDirective = ['$animate', function($animate) {
18772
18876
  * @priority 400
18773
18877
  *
18774
18878
  * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,
18775
- * make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`.
18879
+ * make sure you wrap it in **single** quotes, e.g. `src="'myPartialTemplate.html'"`.
18776
18880
  * @param {string=} onload Expression to evaluate when a new partial is loaded.
18777
18881
  *
18778
18882
  * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll
@@ -18886,7 +18990,6 @@ var ngIfDirective = ['$animate', function($animate) {
18886
18990
  /**
18887
18991
  * @ngdoc event
18888
18992
  * @name ngInclude#$includeContentRequested
18889
- * @eventOf ng.directive:ngInclude
18890
18993
  * @eventType emit on the scope ngInclude was declared in
18891
18994
  * @description
18892
18995
  * Emitted every time the ngInclude content is requested.
@@ -18896,7 +18999,6 @@ var ngIfDirective = ['$animate', function($animate) {
18896
18999
  /**
18897
19000
  * @ngdoc event
18898
19001
  * @name ngInclude#$includeContentLoaded
18899
- * @eventOf ng.directive:ngInclude
18900
19002
  * @eventType emit on the current ngInclude scope
18901
19003
  * @description
18902
19004
  * Emitted every time the ngInclude content is reloaded.
@@ -19383,9 +19485,11 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp
19383
19485
  * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
19384
19486
  *
19385
19487
  * @animations
19386
- * enter - when a new item is added to the list or when an item is revealed after a filter
19387
- * leave - when an item is removed from the list or when an item is filtered out
19388
- * move - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
19488
+ * **.enter** - when a new item is added to the list or when an item is revealed after a filter
19489
+ *
19490
+ * **.leave** - when an item is removed from the list or when an item is filtered out
19491
+ *
19492
+ * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
19389
19493
  *
19390
19494
  * @element ANY
19391
19495
  * @scope
@@ -20117,7 +20221,6 @@ var ngStyleDirective = ngDirective(function(scope, element, attr) {
20117
20221
  * @scope
20118
20222
  * @priority 800
20119
20223
  * @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.
20120
- * @paramDescription
20121
20224
  * On child elements add:
20122
20225
  *
20123
20226
  * * `ngSwitchWhen`: the case statement to match against. If match then this
@@ -20366,7 +20469,7 @@ var ngTranscludeDirective = ngDirective({
20366
20469
  * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
20367
20470
  * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
20368
20471
  *
20369
- * @param {'text/ng-template'} type Must be set to `'text/ng-template'`.
20472
+ * @param {string} type Must be set to `'text/ng-template'`.
20370
20473
  * @param {string} id Cache name of the template.
20371
20474
  *
20372
20475
  * @example
@@ -20797,6 +20900,12 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
20797
20900
  value = valueFn(scope, locals);
20798
20901
  }
20799
20902
  }
20903
+ // Update the null option's selected property here so $render cleans it up correctly
20904
+ if (optionGroupsCache[0].length > 1) {
20905
+ if (optionGroupsCache[0][1].id !== key) {
20906
+ optionGroupsCache[0][1].selected = false;
20907
+ }
20908
+ }
20800
20909
  }
20801
20910
  ctrl.$setViewValue(value);
20802
20911
  });
@@ -20934,7 +21043,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
20934
21043
  lastElement.val(existingOption.id = option.id);
20935
21044
  }
20936
21045
  // lastElement.prop('selected') provided by jQuery has side-effects
20937
- if (lastElement[0].selected !== option.selected) {
21046
+ if (existingOption.selected !== option.selected) {
20938
21047
  lastElement.prop('selected', (existingOption.selected = option.selected));
20939
21048
  }
20940
21049
  } else {
@@ -21038,6 +21147,12 @@ var styleDirective = valueFn({
21038
21147
  terminal: true
21039
21148
  });
21040
21149
 
21150
+ if (window.angular.bootstrap) {
21151
+ //AngularJS is already loaded, so we can return here...
21152
+ console.log('WARNING: Tried to load angular more than once.');
21153
+ return;
21154
+ }
21155
+
21041
21156
  //try to bind to jquery now so that one can write angular.element().read()
21042
21157
  //but we will rebind on bootstrap again.
21043
21158
  bindJQuery();