angular-gem 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.4
2
+ * @license AngularJS v1.2.5
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.4
2
+ * @license AngularJS v1.2.5
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.4/' +
71
+ message = message + '\nhttp://errors.angularjs.org/1.2.5/' +
72
72
  (module ? module + '/' : '') + code;
73
73
  for (i = 2; i < arguments.length; i++) {
74
74
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -472,7 +472,7 @@ function valueFn(value) {return function() {return value;};}
472
472
  * @param {*} value Reference to check.
473
473
  * @returns {boolean} True if `value` is undefined.
474
474
  */
475
- function isUndefined(value){return typeof value == 'undefined';}
475
+ function isUndefined(value){return typeof value === 'undefined';}
476
476
 
477
477
 
478
478
  /**
@@ -486,7 +486,7 @@ function isUndefined(value){return typeof value == 'undefined';}
486
486
  * @param {*} value Reference to check.
487
487
  * @returns {boolean} True if `value` is defined.
488
488
  */
489
- function isDefined(value){return typeof value != 'undefined';}
489
+ function isDefined(value){return typeof value !== 'undefined';}
490
490
 
491
491
 
492
492
  /**
@@ -501,7 +501,7 @@ function isDefined(value){return typeof value != 'undefined';}
501
501
  * @param {*} value Reference to check.
502
502
  * @returns {boolean} True if `value` is an `Object` but not `null`.
503
503
  */
504
- function isObject(value){return value != null && typeof value == 'object';}
504
+ function isObject(value){return value != null && typeof value === 'object';}
505
505
 
506
506
 
507
507
  /**
@@ -515,7 +515,7 @@ function isObject(value){return value != null && typeof value == 'object';}
515
515
  * @param {*} value Reference to check.
516
516
  * @returns {boolean} True if `value` is a `String`.
517
517
  */
518
- function isString(value){return typeof value == 'string';}
518
+ function isString(value){return typeof value === 'string';}
519
519
 
520
520
 
521
521
  /**
@@ -529,7 +529,7 @@ function isString(value){return typeof value == 'string';}
529
529
  * @param {*} value Reference to check.
530
530
  * @returns {boolean} True if `value` is a `Number`.
531
531
  */
532
- function isNumber(value){return typeof value == 'number';}
532
+ function isNumber(value){return typeof value === 'number';}
533
533
 
534
534
 
535
535
  /**
@@ -544,7 +544,7 @@ function isNumber(value){return typeof value == 'number';}
544
544
  * @returns {boolean} True if `value` is a `Date`.
545
545
  */
546
546
  function isDate(value){
547
- return toString.apply(value) == '[object Date]';
547
+ return toString.call(value) === '[object Date]';
548
548
  }
549
549
 
550
550
 
@@ -560,7 +560,7 @@ function isDate(value){
560
560
  * @returns {boolean} True if `value` is an `Array`.
561
561
  */
562
562
  function isArray(value) {
563
- return toString.apply(value) == '[object Array]';
563
+ return toString.call(value) === '[object Array]';
564
564
  }
565
565
 
566
566
 
@@ -575,7 +575,7 @@ function isArray(value) {
575
575
  * @param {*} value Reference to check.
576
576
  * @returns {boolean} True if `value` is a `Function`.
577
577
  */
578
- function isFunction(value){return typeof value == 'function';}
578
+ function isFunction(value){return typeof value === 'function';}
579
579
 
580
580
 
581
581
  /**
@@ -586,7 +586,7 @@ function isFunction(value){return typeof value == 'function';}
586
586
  * @returns {boolean} True if `value` is a `RegExp`.
587
587
  */
588
588
  function isRegExp(value) {
589
- return toString.apply(value) == '[object RegExp]';
589
+ return toString.call(value) === '[object RegExp]';
590
590
  }
591
591
 
592
592
 
@@ -608,12 +608,12 @@ function isScope(obj) {
608
608
 
609
609
 
610
610
  function isFile(obj) {
611
- return toString.apply(obj) === '[object File]';
611
+ return toString.call(obj) === '[object File]';
612
612
  }
613
613
 
614
614
 
615
615
  function isBoolean(value) {
616
- return typeof value == 'boolean';
616
+ return typeof value === 'boolean';
617
617
  }
618
618
 
619
619
 
@@ -717,7 +717,7 @@ function includes(array, obj) {
717
717
  function indexOf(array, obj) {
718
718
  if (array.indexOf) return array.indexOf(obj);
719
719
 
720
- for ( var i = 0; i < array.length; i++) {
720
+ for (var i = 0; i < array.length; i++) {
721
721
  if (obj === array[i]) return i;
722
722
  }
723
723
  return -1;
@@ -1053,7 +1053,7 @@ function startingTag(element) {
1053
1053
  try {
1054
1054
  // turns out IE does not let you set .html() on elements which
1055
1055
  // are not allowed to have children. So we just ignore it.
1056
- element.html('');
1056
+ element.empty();
1057
1057
  } catch(e) {}
1058
1058
  // As Per DOM Standards
1059
1059
  var TEXT_NODE = 3;
@@ -1767,6 +1767,7 @@ function setupModuleLoader(window) {
1767
1767
  ngHideDirective,
1768
1768
  ngIfDirective,
1769
1769
  ngIncludeDirective,
1770
+ ngIncludeFillContentDirective,
1770
1771
  ngInitDirective,
1771
1772
  ngNonBindableDirective,
1772
1773
  ngPluralizeDirective,
@@ -1828,11 +1829,11 @@ function setupModuleLoader(window) {
1828
1829
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
1829
1830
  */
1830
1831
  var version = {
1831
- full: '1.2.4', // all of these placeholder strings will be replaced by grunt's
1832
+ full: '1.2.5', // all of these placeholder strings will be replaced by grunt's
1832
1833
  major: 1, // package task
1833
1834
  minor: 2,
1834
- dot: 4,
1835
- codeName: 'wormhole-baster'
1835
+ dot: 5,
1836
+ codeName: 'singularity-expansion'
1836
1837
  };
1837
1838
 
1838
1839
 
@@ -1920,6 +1921,9 @@ function publishExternalAPI(angular){
1920
1921
  ngRequired: requiredDirective,
1921
1922
  ngValue: ngValueDirective
1922
1923
  }).
1924
+ directive({
1925
+ ngInclude: ngIncludeFillContentDirective
1926
+ }).
1923
1927
  directive(ngAttributeAliasDirectives).
1924
1928
  directive(ngEventDirectives);
1925
1929
  $provide.provider({
@@ -1997,6 +2001,7 @@ function publishExternalAPI(angular){
1997
2001
  * - [`contents()`](http://api.jquery.com/contents/)
1998
2002
  * - [`css()`](http://api.jquery.com/css/)
1999
2003
  * - [`data()`](http://api.jquery.com/data/)
2004
+ * - [`empty()`](http://api.jquery.com/empty/)
2000
2005
  * - [`eq()`](http://api.jquery.com/eq/)
2001
2006
  * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name
2002
2007
  * - [`hasClass()`](http://api.jquery.com/hasClass/)
@@ -2309,6 +2314,15 @@ function jqLiteInheritedData(element, name, value) {
2309
2314
  }
2310
2315
  }
2311
2316
 
2317
+ function jqLiteEmpty(element) {
2318
+ for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {
2319
+ jqLiteDealoc(childNodes[i]);
2320
+ }
2321
+ while (element.firstChild) {
2322
+ element.removeChild(element.firstChild);
2323
+ }
2324
+ }
2325
+
2312
2326
  //////////////////////////////////////////
2313
2327
  // Functions which are declared directly.
2314
2328
  //////////////////////////////////////////
@@ -2503,7 +2517,9 @@ forEach({
2503
2517
  jqLiteDealoc(childNodes[i]);
2504
2518
  }
2505
2519
  element.innerHTML = value;
2506
- }
2520
+ },
2521
+
2522
+ empty: jqLiteEmpty
2507
2523
  }, function(fn, name){
2508
2524
  /**
2509
2525
  * Properties: writes return selection, reads return first value
@@ -2513,11 +2529,13 @@ forEach({
2513
2529
 
2514
2530
  // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
2515
2531
  // in a way that survives minification.
2516
- if (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined) {
2532
+ // jqLiteEmpty takes no arguments but is a setter.
2533
+ if (fn !== jqLiteEmpty &&
2534
+ (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) {
2517
2535
  if (isObject(arg1)) {
2518
2536
 
2519
2537
  // we are a write, but the object properties are the key/values
2520
- for(i=0; i < this.length; i++) {
2538
+ for (i = 0; i < this.length; i++) {
2521
2539
  if (fn === jqLiteData) {
2522
2540
  // data() takes the whole object in jQuery
2523
2541
  fn(this[i], arg1);
@@ -2542,7 +2560,7 @@ forEach({
2542
2560
  }
2543
2561
  } else {
2544
2562
  // we are a write, so apply to all children
2545
- for(i=0; i < this.length; i++) {
2563
+ for (i = 0; i < this.length; i++) {
2546
2564
  fn(this[i], arg1, arg2);
2547
2565
  }
2548
2566
  // return self for chaining
@@ -2913,6 +2931,28 @@ HashMap.prototype = {
2913
2931
  * $rootScope.$digest();
2914
2932
  * });
2915
2933
  * </pre>
2934
+ *
2935
+ * Sometimes you want to get access to the injector of a currently running Angular app
2936
+ * from outside Angular. Perhaps, you want to inject and compile some markup after the
2937
+ * application has been bootstrapped. You can do this using extra `injector()` added
2938
+ * to JQuery/jqLite elements. See {@link angular.element}.
2939
+ *
2940
+ * *This is fairly rare but could be the case if a third party library is injecting the
2941
+ * markup.*
2942
+ *
2943
+ * In the following example a new block of HTML containing a `ng-controller`
2944
+ * directive is added to the end of the document body by JQuery. We then compile and link
2945
+ * it into the current AngularJS scope.
2946
+ *
2947
+ * <pre>
2948
+ * var $div = $('<div ng-controller="MyCtrl">{{content.label}}</div>');
2949
+ * $(document.body).append($div);
2950
+ *
2951
+ * angular.element(document).injector().invoke(function($compile) {
2952
+ * var scope = angular.element($div).scope();
2953
+ * $compile($div)(scope);
2954
+ * });
2955
+ * </pre>
2916
2956
  */
2917
2957
 
2918
2958
 
@@ -3633,24 +3673,9 @@ function createInjector(modulesToLoad) {
3633
3673
  fn = fn[length];
3634
3674
  }
3635
3675
 
3636
-
3637
- // Performance optimization: http://jsperf.com/apply-vs-call-vs-invoke
3638
- switch (self ? -1 : args.length) {
3639
- case 0: return fn();
3640
- case 1: return fn(args[0]);
3641
- case 2: return fn(args[0], args[1]);
3642
- case 3: return fn(args[0], args[1], args[2]);
3643
- case 4: return fn(args[0], args[1], args[2], args[3]);
3644
- case 5: return fn(args[0], args[1], args[2], args[3], args[4]);
3645
- case 6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]);
3646
- case 7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
3647
- case 8: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
3648
- case 9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7],
3649
- args[8]);
3650
- case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7],
3651
- args[8], args[9]);
3652
- default: return fn.apply(self, args);
3653
- }
3676
+ // http://jsperf.com/angularjs-invoke-apply-vs-switch
3677
+ // #5388
3678
+ return fn.apply(self, args);
3654
3679
  }
3655
3680
 
3656
3681
  function instantiate(Type, locals) {
@@ -5836,7 +5861,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
5836
5861
  });
5837
5862
  } else {
5838
5863
  $template = jqLite(jqLiteClone(compileNode)).contents();
5839
- $compileNode.html(''); // clear contents
5864
+ $compileNode.empty(); // clear contents
5840
5865
  childTranscludeFn = compile($template, transcludeFn);
5841
5866
  }
5842
5867
  }
@@ -6017,7 +6042,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
6017
6042
  optional = (match[2] == '?'),
6018
6043
  mode = match[1], // @, =, or &
6019
6044
  lastValue,
6020
- parentGet, parentSet;
6045
+ parentGet, parentSet, compare;
6021
6046
 
6022
6047
  isolateScope.$$isolateBindings[scopeName] = mode + attrName;
6023
6048
 
@@ -6040,6 +6065,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
6040
6065
  return;
6041
6066
  }
6042
6067
  parentGet = $parse(attrs[attrName]);
6068
+ if (parentGet.literal) {
6069
+ compare = equals;
6070
+ } else {
6071
+ compare = function(a,b) { return a === b; };
6072
+ }
6043
6073
  parentSet = parentGet.assign || function() {
6044
6074
  // reset the change, or we will throw this exception on every $digest
6045
6075
  lastValue = isolateScope[scopeName] = parentGet(scope);
@@ -6050,10 +6080,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
6050
6080
  lastValue = isolateScope[scopeName] = parentGet(scope);
6051
6081
  isolateScope.$watch(function parentValueWatch() {
6052
6082
  var parentValue = parentGet(scope);
6053
-
6054
- if (parentValue !== isolateScope[scopeName]) {
6083
+ if (!compare(parentValue, isolateScope[scopeName])) {
6055
6084
  // we are out of sync and need to copy
6056
- if (parentValue !== lastValue) {
6085
+ if (!compare(parentValue, lastValue)) {
6057
6086
  // parent changed and it has precedence
6058
6087
  isolateScope[scopeName] = parentValue;
6059
6088
  } else {
@@ -6062,7 +6091,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
6062
6091
  }
6063
6092
  }
6064
6093
  return lastValue = parentValue;
6065
- });
6094
+ }, null, parentGet.literal);
6066
6095
  break;
6067
6096
 
6068
6097
  case '&':
@@ -6264,7 +6293,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
6264
6293
  ? origAsyncDirective.templateUrl($compileNode, tAttrs)
6265
6294
  : origAsyncDirective.templateUrl;
6266
6295
 
6267
- $compileNode.html('');
6296
+ $compileNode.empty();
6268
6297
 
6269
6298
  $http.get($sce.getTrustedResourceUrl(templateUrl), {cache: $templateCache}).
6270
6299
  success(function(content) {
@@ -10579,7 +10608,7 @@ function $ParseProvider() {
10579
10608
  *
10580
10609
  * # Differences between Kris Kowal's Q and $q
10581
10610
  *
10582
- * There are three main differences:
10611
+ * There are two main differences:
10583
10612
  *
10584
10613
  * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation
10585
10614
  * mechanism in angular, which means faster propagation of resolution or rejection into your
@@ -11113,11 +11142,11 @@ function $RootScopeProvider(){
11113
11142
  * @description
11114
11143
  * Creates a new child {@link ng.$rootScope.Scope scope}.
11115
11144
  *
11116
- * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} and
11117
- * {@link ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the
11118
- * scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.
11145
+ * The parent scope will propagate the {@link ng.$rootScope.Scope#methods_$digest $digest()} and
11146
+ * {@link ng.$rootScope.Scope#methods_$digest $digest()} events. The scope can be removed from the
11147
+ * scope hierarchy using {@link ng.$rootScope.Scope#methods_$destroy $destroy()}.
11119
11148
  *
11120
- * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is
11149
+ * {@link ng.$rootScope.Scope#methods_$destroy $destroy()} must be called on a scope when it is
11121
11150
  * desired for the scope and its child scopes to be permanently detached from the parent and
11122
11151
  * thus stop participating in model change detection and listener notification by invoking.
11123
11152
  *
@@ -11170,11 +11199,11 @@ function $RootScopeProvider(){
11170
11199
  * @description
11171
11200
  * Registers a `listener` callback to be executed whenever the `watchExpression` changes.
11172
11201
  *
11173
- * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest
11202
+ * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#methods_$digest
11174
11203
  * $digest()} and should return the value that will be watched. (Since
11175
- * {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the
11204
+ * {@link ng.$rootScope.Scope#methods_$digest $digest()} reruns when it detects changes the
11176
11205
  * `watchExpression` can execute multiple times per
11177
- * {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
11206
+ * {@link ng.$rootScope.Scope#methods_$digest $digest()} and should be idempotent.)
11178
11207
  * - The `listener` is called only when the value from the current `watchExpression` and the
11179
11208
  * previous call to `watchExpression` are not equal (with the exception of the initial run,
11180
11209
  * see below). The inequality is determined according to
@@ -11186,13 +11215,13 @@ function $RootScopeProvider(){
11186
11215
  * iteration limit is 10 to prevent an infinite loop deadlock.
11187
11216
  *
11188
11217
  *
11189
- * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,
11218
+ * If you want to be notified whenever {@link ng.$rootScope.Scope#methods_$digest $digest} is called,
11190
11219
  * you can register a `watchExpression` function with no `listener`. (Since `watchExpression`
11191
- * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a
11220
+ * can execute multiple times per {@link ng.$rootScope.Scope#methods_$digest $digest} cycle when a
11192
11221
  * change is detected, be prepared for multiple calls to your listener.)
11193
11222
  *
11194
11223
  * After a watcher is registered with the scope, the `listener` fn is called asynchronously
11195
- * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
11224
+ * (via {@link ng.$rootScope.Scope#methods_$evalAsync $evalAsync}) to initialize the
11196
11225
  * watcher. In rare cases, this is undesirable because the listener is called when the result
11197
11226
  * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
11198
11227
  * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
@@ -11256,7 +11285,7 @@ function $RootScopeProvider(){
11256
11285
  *
11257
11286
  *
11258
11287
  * @param {(function()|string)} watchExpression Expression that is evaluated on each
11259
- * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
11288
+ * {@link ng.$rootScope.Scope#methods_$digest $digest} cycle. A change in the return value triggers
11260
11289
  * a call to the `listener`.
11261
11290
  *
11262
11291
  * - `string`: Evaluated as {@link guide/expression expression}
@@ -11354,7 +11383,7 @@ function $RootScopeProvider(){
11354
11383
  *
11355
11384
  * @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The
11356
11385
  * expression value should evaluate to an object or an array which is observed on each
11357
- * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
11386
+ * {@link ng.$rootScope.Scope#methods_$digest $digest} cycle. Any shallow change within the
11358
11387
  * collection will trigger a call to the `listener`.
11359
11388
  *
11360
11389
  * @param {function(newCollection, oldCollection, scope)} listener a callback function that is
@@ -11459,9 +11488,9 @@ function $RootScopeProvider(){
11459
11488
  * @function
11460
11489
  *
11461
11490
  * @description
11462
- * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and
11463
- * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change
11464
- * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}
11491
+ * Processes all of the {@link ng.$rootScope.Scope#methods_$watch watchers} of the current scope and
11492
+ * its children. Because a {@link ng.$rootScope.Scope#methods_$watch watcher}'s listener can change
11493
+ * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#methods_$watch watchers}
11465
11494
  * until no more listeners are firing. This means that it is possible to get into an infinite
11466
11495
  * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of
11467
11496
  * iterations exceeds 10.
@@ -11469,12 +11498,12 @@ function $RootScopeProvider(){
11469
11498
  * Usually, you don't call `$digest()` directly in
11470
11499
  * {@link ng.directive:ngController controllers} or in
11471
11500
  * {@link ng.$compileProvider#methods_directive directives}.
11472
- * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within
11501
+ * Instead, you should call {@link ng.$rootScope.Scope#methods_$apply $apply()} (typically from within
11473
11502
  * a {@link ng.$compileProvider#methods_directive directives}), which will force a `$digest()`.
11474
11503
  *
11475
11504
  * If you want to be notified whenever `$digest()` is called,
11476
11505
  * you can register a `watchExpression` function with
11477
- * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.
11506
+ * {@link ng.$rootScope.Scope#methods_$watch $watch()} with no `listener`.
11478
11507
  *
11479
11508
  * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
11480
11509
  *
@@ -11629,7 +11658,7 @@ function $RootScopeProvider(){
11629
11658
  *
11630
11659
  * @description
11631
11660
  * Removes the current scope (and all of its children) from the parent scope. Removal implies
11632
- * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer
11661
+ * that calls to {@link ng.$rootScope.Scope#methods_$digest $digest()} will no longer
11633
11662
  * propagate to the current scope and its children. Removal also implies that the current
11634
11663
  * scope is eligible for garbage collection.
11635
11664
  *
@@ -11711,7 +11740,7 @@ function $RootScopeProvider(){
11711
11740
  *
11712
11741
  * - it will execute after the function that scheduled the evaluation (preferably before DOM
11713
11742
  * rendering).
11714
- * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after
11743
+ * - at least one {@link ng.$rootScope.Scope#methods_$digest $digest cycle} will be performed after
11715
11744
  * `expression` execution.
11716
11745
  *
11717
11746
  * Any exceptions from the execution of the expression are forwarded to the
@@ -11756,7 +11785,7 @@ function $RootScopeProvider(){
11756
11785
  * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).
11757
11786
  * Because we are calling into the angular framework we need to perform proper scope life
11758
11787
  * cycle of {@link ng.$exceptionHandler exception handling},
11759
- * {@link ng.$rootScope.Scope#$digest executing watches}.
11788
+ * {@link ng.$rootScope.Scope#methods_$digest executing watches}.
11760
11789
  *
11761
11790
  * ## Life cycle
11762
11791
  *
@@ -11777,11 +11806,11 @@ function $RootScopeProvider(){
11777
11806
  * Scope's `$apply()` method transitions through the following stages:
11778
11807
  *
11779
11808
  * 1. The {@link guide/expression expression} is executed using the
11780
- * {@link ng.$rootScope.Scope#$eval $eval()} method.
11809
+ * {@link ng.$rootScope.Scope#methods_$eval $eval()} method.
11781
11810
  * 2. Any exceptions from the execution of the expression are forwarded to the
11782
11811
  * {@link ng.$exceptionHandler $exceptionHandler} service.
11783
- * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the
11784
- * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.
11812
+ * 3. The {@link ng.$rootScope.Scope#methods_$watch watch} listeners are fired immediately after the
11813
+ * expression was executed using the {@link ng.$rootScope.Scope#methods_$digest $digest()} method.
11785
11814
  *
11786
11815
  *
11787
11816
  * @param {(string|function())=} exp An angular expression to be executed.
@@ -11815,7 +11844,7 @@ function $RootScopeProvider(){
11815
11844
  * @function
11816
11845
  *
11817
11846
  * @description
11818
- * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for
11847
+ * Listens on events of a given type. See {@link ng.$rootScope.Scope#methods_$emit $emit} for
11819
11848
  * discussion of event life cycle.
11820
11849
  *
11821
11850
  * The event listener function format is: `function(event, args...)`. The `event` object
@@ -11856,20 +11885,20 @@ function $RootScopeProvider(){
11856
11885
  *
11857
11886
  * @description
11858
11887
  * Dispatches an event `name` upwards through the scope hierarchy notifying the
11859
- * registered {@link ng.$rootScope.Scope#$on} listeners.
11888
+ * registered {@link ng.$rootScope.Scope#methods_$on} listeners.
11860
11889
  *
11861
11890
  * The event life cycle starts at the scope on which `$emit` was called. All
11862
- * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
11891
+ * {@link ng.$rootScope.Scope#methods_$on listeners} listening for `name` event on this scope get
11863
11892
  * notified. Afterwards, the event traverses upwards toward the root scope and calls all
11864
11893
  * registered listeners along the way. The event will stop propagating if one of the listeners
11865
11894
  * cancels it.
11866
11895
  *
11867
- * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
11896
+ * Any exception emitted from the {@link ng.$rootScope.Scope#methods_$on listeners} will be passed
11868
11897
  * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
11869
11898
  *
11870
11899
  * @param {string} name Event name to emit.
11871
11900
  * @param {...*} args Optional set of arguments which will be passed onto the event listeners.
11872
- * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).
11901
+ * @return {Object} Event object (see {@link ng.$rootScope.Scope#methods_$on}).
11873
11902
  */
11874
11903
  $emit: function(name, args) {
11875
11904
  var empty = [],
@@ -11925,19 +11954,19 @@ function $RootScopeProvider(){
11925
11954
  *
11926
11955
  * @description
11927
11956
  * Dispatches an event `name` downwards to all child scopes (and their children) notifying the
11928
- * registered {@link ng.$rootScope.Scope#$on} listeners.
11957
+ * registered {@link ng.$rootScope.Scope#methods_$on} listeners.
11929
11958
  *
11930
11959
  * The event life cycle starts at the scope on which `$broadcast` was called. All
11931
- * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
11960
+ * {@link ng.$rootScope.Scope#methods_$on listeners} listening for `name` event on this scope get
11932
11961
  * notified. Afterwards, the event propagates to all direct and indirect scopes of the current
11933
11962
  * scope and calls all registered listeners along the way. The event cannot be canceled.
11934
11963
  *
11935
- * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
11964
+ * Any exception emitted from the {@link ng.$rootScope.Scope#methods_$on listeners} will be passed
11936
11965
  * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
11937
11966
  *
11938
11967
  * @param {string} name Event name to broadcast.
11939
11968
  * @param {...*} args Optional set of arguments which will be passed onto the event listeners.
11940
- * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}
11969
+ * @return {Object} Event object, see {@link ng.$rootScope.Scope#methods_$on}
11941
11970
  */
11942
11971
  $broadcast: function(name, args) {
11943
11972
  var target = this,
@@ -14674,14 +14703,16 @@ var htmlAnchorDirective = valueFn({
14674
14703
  element.append(document.createComment('IE fix'));
14675
14704
  }
14676
14705
 
14677
- return function(scope, element) {
14678
- element.on('click', function(event){
14679
- // if we have no href url, then don't navigate anywhere.
14680
- if (!element.attr('href')) {
14681
- event.preventDefault();
14682
- }
14683
- });
14684
- };
14706
+ if (!attr.href && !attr.name) {
14707
+ return function(scope, element) {
14708
+ element.on('click', function(event){
14709
+ // if we have no href url, then don't navigate anywhere.
14710
+ if (!element.attr('href')) {
14711
+ event.preventDefault();
14712
+ }
14713
+ });
14714
+ };
14715
+ }
14685
14716
  }
14686
14717
  });
14687
14718
 
@@ -16862,7 +16893,6 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
16862
16893
  id="{{name}}"
16863
16894
  name="favorite">
16864
16895
  </label>
16865
- </span>
16866
16896
  <div>You chose {{my.favorite}}</div>
16867
16897
  </form>
16868
16898
  </doc:source>
@@ -18253,13 +18283,14 @@ var ngIfDirective = ['$animate', function($animate) {
18253
18283
  * @description
18254
18284
  * Emitted every time the ngInclude content is reloaded.
18255
18285
  */
18256
- var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile', '$animate', '$sce',
18257
- function($http, $templateCache, $anchorScroll, $compile, $animate, $sce) {
18286
+ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$animate', '$sce',
18287
+ function($http, $templateCache, $anchorScroll, $animate, $sce) {
18258
18288
  return {
18259
18289
  restrict: 'ECA',
18260
18290
  priority: 400,
18261
18291
  terminal: true,
18262
18292
  transclude: 'element',
18293
+ controller: angular.noop,
18263
18294
  compile: function(element, attr) {
18264
18295
  var srcExp = attr.ngInclude || attr.src,
18265
18296
  onloadExp = attr.onload || '',
@@ -18293,6 +18324,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
18293
18324
  $http.get(src, {cache: $templateCache}).success(function(response) {
18294
18325
  if (thisChangeId !== changeCounter) return;
18295
18326
  var newScope = scope.$new();
18327
+ ctrl.template = response;
18296
18328
 
18297
18329
  // Note: This will also link all children of ng-include that were contained in the original
18298
18330
  // html. If that content contains controllers, ... they could pollute/change the scope.
@@ -18300,15 +18332,14 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
18300
18332
  // Note: We can't remove them in the cloneAttchFn of $transclude as that
18301
18333
  // function is called before linking the content, which would apply child
18302
18334
  // directives to non existing elements.
18303
- var clone = $transclude(newScope, noop);
18304
- cleanupLastIncludeContent();
18335
+ var clone = $transclude(newScope, function(clone) {
18336
+ cleanupLastIncludeContent();
18337
+ $animate.enter(clone, null, $element, afterAnimation);
18338
+ });
18305
18339
 
18306
18340
  currentScope = newScope;
18307
18341
  currentElement = clone;
18308
18342
 
18309
- currentElement.html(response);
18310
- $animate.enter(currentElement, null, $element, afterAnimation);
18311
- $compile(currentElement.contents())(currentScope);
18312
18343
  currentScope.$emit('$includeContentLoaded');
18313
18344
  scope.$eval(onloadExp);
18314
18345
  }).error(function() {
@@ -18317,6 +18348,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
18317
18348
  scope.$emit('$includeContentRequested');
18318
18349
  } else {
18319
18350
  cleanupLastIncludeContent();
18351
+ ctrl.template = null;
18320
18352
  }
18321
18353
  });
18322
18354
  };
@@ -18324,6 +18356,24 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
18324
18356
  };
18325
18357
  }];
18326
18358
 
18359
+ // This directive is called during the $transclude call of the first `ngInclude` directive.
18360
+ // It will replace and compile the content of the element with the loaded template.
18361
+ // We need this directive so that the element content is already filled when
18362
+ // the link function of another directive on the same element as ngInclude
18363
+ // is called.
18364
+ var ngIncludeFillContentDirective = ['$compile',
18365
+ function($compile) {
18366
+ return {
18367
+ restrict: 'ECA',
18368
+ priority: -400,
18369
+ require: 'ngInclude',
18370
+ link: function(scope, $element, $attr, ctrl) {
18371
+ $element.html(ctrl.template);
18372
+ $compile($element.contents())(scope);
18373
+ }
18374
+ };
18375
+ }];
18376
+
18327
18377
  /**
18328
18378
  * @ngdoc directive
18329
18379
  * @name ng.directive:ngInit
@@ -19370,19 +19420,26 @@ var ngStyleDirective = ngDirective(function(scope, element, attr) {
19370
19420
  * @restrict EA
19371
19421
  *
19372
19422
  * @description
19373
- * The ngSwitch directive is used to conditionally swap DOM structure on your template based on a scope expression.
19374
- * Elements within ngSwitch but without ngSwitchWhen or ngSwitchDefault directives will be preserved at the location
19423
+ * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.
19424
+ * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location
19375
19425
  * as specified in the template.
19376
19426
  *
19377
19427
  * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it
19378
- * from the template cache), ngSwitch simply choses one of the nested elements and makes it visible based on which element
19428
+ * from the template cache), `ngSwitch` simply choses one of the nested elements and makes it visible based on which element
19379
19429
  * matches the value obtained from the evaluated expression. In other words, you define a container element
19380
- * (where you place the directive), place an expression on the **on="..." attribute**
19381
- * (or the **ng-switch="..." attribute**), define any inner elements inside of the directive and place
19430
+ * (where you place the directive), place an expression on the **`on="..."` attribute**
19431
+ * (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place
19382
19432
  * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on
19383
19433
  * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default
19384
19434
  * attribute is displayed.
19385
19435
  *
19436
+ * <div class="alert alert-info">
19437
+ * Be aware that the attribute values to match against cannot be expressions. They are interpreted
19438
+ * as literal string values to match against.
19439
+ * For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the
19440
+ * value of the expression `$scope.someVal`.
19441
+ * </div>
19442
+
19386
19443
  * @animations
19387
19444
  * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container
19388
19445
  * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM
@@ -19394,6 +19451,7 @@ var ngStyleDirective = ngDirective(function(scope, element, attr) {
19394
19451
  * <ANY ng-switch-default>...</ANY>
19395
19452
  * </ANY>
19396
19453
  *
19454
+ *
19397
19455
  * @scope
19398
19456
  * @priority 800
19399
19457
  * @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.
@@ -19611,7 +19669,7 @@ var ngTranscludeDirective = ngDirective({
19611
19669
 
19612
19670
  link: function($scope, $element, $attrs, controller) {
19613
19671
  controller.$transclude(function(clone) {
19614
- $element.html('');
19672
+ $element.empty();
19615
19673
  $element.append(clone);
19616
19674
  });
19617
19675
  }
@@ -19995,13 +20053,13 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
19995
20053
  // becomes the compilation root
19996
20054
  nullOption.removeClass('ng-scope');
19997
20055
 
19998
- // we need to remove it before calling selectElement.html('') because otherwise IE will
20056
+ // we need to remove it before calling selectElement.empty() because otherwise IE will
19999
20057
  // remove the label from the element. wtf?
20000
20058
  nullOption.remove();
20001
20059
  }
20002
20060
 
20003
20061
  // clear contents, we'll add what's needed based on the model
20004
- selectElement.html('');
20062
+ selectElement.empty();
20005
20063
 
20006
20064
  selectElement.on('change', function() {
20007
20065
  scope.$apply(function() {