angularjs-rails 1.2.0.rc1 → 1.2.0.rc2

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.0rc1
2
+ * @license AngularJS v1.2.0-rc.2
3
3
  * (c) 2010-2012 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -8,6 +8,17 @@
8
8
  /**
9
9
  * @ngdoc overview
10
10
  * @name ngCookies
11
+ * @description
12
+ *
13
+ * # ngCookies
14
+ *
15
+ * Provides the {@link ngCookies.$cookies `$cookies`} and
16
+ * {@link ngCookies.$cookieStore `$cookieStore`} services.
17
+ *
18
+ * {@installModule cookies}
19
+ *
20
+ * See {@link ngCookies.$cookies `$cookies`} and
21
+ * {@link ngCookies.$cookieStore `$cookieStore`} for usage.
11
22
  */
12
23
 
13
24
 
@@ -23,6 +34,8 @@ angular.module('ngCookies', ['ng']).
23
34
  * Only a simple Object is exposed and by adding or removing properties to/from
24
35
  * this object, new cookies are created/deleted at the end of current $eval.
25
36
  *
37
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
38
+ *
26
39
  * @example
27
40
  <doc:example>
28
41
  <doc:source>
@@ -127,6 +140,9 @@ angular.module('ngCookies', ['ng']).
127
140
  * Provides a key-value (string-object) storage, that is backed by session cookies.
128
141
  * Objects put or retrieved from this storage are automatically serialized or
129
142
  * deserialized by angular's toJson/fromJson.
143
+ *
144
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
145
+ *
130
146
  * @example
131
147
  */
132
148
  factory('$cookieStore', ['$cookies', function($cookies) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.0rc1
2
+ * @license AngularJS v1.2.0-rc.2
3
3
  * (c) 2010-2012 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -29,10 +29,13 @@ function setupModuleLoader(window) {
29
29
  * @name angular.module
30
30
  * @description
31
31
  *
32
- * The `angular.module` is a global place for creating and registering Angular modules. All
33
- * modules (angular core or 3rd party) that should be available to an application must be
32
+ * The `angular.module` is a global place for creating, registering and retrieving Angular modules.
33
+ * All modules (angular core or 3rd party) that should be available to an application must be
34
34
  * registered using this mechanism.
35
35
  *
36
+ * When passed two or more arguments, a new module is created. If passed only one argument, an
37
+ * existing module (the name passed as the first argument to `module`) is retrieved.
38
+ *
36
39
  *
37
40
  * # Module
38
41
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.0rc1
2
+ * @license AngularJS v1.2.0-rc.2
3
3
  * (c) 2010-2012 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  *
@@ -316,7 +316,7 @@ angular.mock.$LogProvider = function() {
316
316
  }
317
317
 
318
318
  this.debugEnabled = function(flag) {
319
- if (isDefined(flag)) {
319
+ if (angular.isDefined(flag)) {
320
320
  debug = flag;
321
321
  return this;
322
322
  } else {
@@ -1851,9 +1851,11 @@ angular.mock.clearDataCache = function() {
1851
1851
  *
1852
1852
  * See {@link angular.mock.inject inject} for usage example
1853
1853
  *
1854
- * @param {...(string|Function)} fns any number of modules which are represented as string
1854
+ * @param {...(string|Function|Object)} fns any number of modules which are represented as string
1855
1855
  * aliases or as anonymous module initialization functions. The modules are used to
1856
- * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded.
1856
+ * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an
1857
+ * object literal is passed they will be register as values in the module, the key being
1858
+ * the module name and the value being what is returned.
1857
1859
  */
1858
1860
  window.module = angular.mock.module = function() {
1859
1861
  var moduleFns = Array.prototype.slice.call(arguments, 0);
@@ -1865,7 +1867,15 @@ angular.mock.clearDataCache = function() {
1865
1867
  } else {
1866
1868
  var modules = currentSpec.$modules || (currentSpec.$modules = []);
1867
1869
  angular.forEach(moduleFns, function(module) {
1868
- modules.push(module);
1870
+ if (angular.isObject(module) && !angular.isArray(module)) {
1871
+ modules.push(function($provide) {
1872
+ angular.forEach(module, function(value, key) {
1873
+ $provide.value(key, value);
1874
+ });
1875
+ });
1876
+ } else {
1877
+ modules.push(module);
1878
+ }
1869
1879
  });
1870
1880
  }
1871
1881
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.0rc1
2
+ * @license AngularJS v1.2.0-rc.2
3
3
  * (c) 2010-2012 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -11,6 +11,16 @@ var $resourceMinErr = angular.$$minErr('$resource');
11
11
  * @ngdoc overview
12
12
  * @name ngResource
13
13
  * @description
14
+ *
15
+ * # ngResource
16
+ *
17
+ * `ngResource` is the name of the optional Angular module that adds support for interacting with
18
+ * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
19
+ * `ngReource` provides the {@link ngResource.$resource `$resource`} serivce.
20
+ *
21
+ * {@installModule resource}
22
+ *
23
+ * See {@link ngResource.$resource `$resource`} for usage.
14
24
  */
15
25
 
16
26
  /**
@@ -25,23 +35,14 @@ var $resourceMinErr = angular.$$minErr('$resource');
25
35
  * The returned resource object has action methods which provide high-level behaviors without
26
36
  * the need to interact with the low level {@link ng.$http $http} service.
27
37
  *
28
- * # Installation
29
- * To use $resource make sure you have included the `angular-resource.js` that comes in Angular
30
- * package. You can also find this file on Google CDN, bower as well as at
31
- * {@link http://code.angularjs.org/ code.angularjs.org}.
32
- *
33
- * Finally load the module in your application:
34
- *
35
- * angular.module('app', ['ngResource']);
36
- *
37
- * and you are ready to get started!
38
+ * Requires the {@link ngResource `ngResource`} module to be installed.
38
39
  *
39
40
  * @param {string} url A parametrized URL template with parameters prefixed by `:` as in
40
41
  * `/user/:username`. If you are using a URL with a port number (e.g.
41
42
  * `http://example.com:8080/api`), it will be respected.
42
43
  *
43
44
  * If you are using a url with a suffix, just add the suffix, like this:
44
- * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')
45
+ * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`
45
46
  * or even `$resource('http://example.com/resource/:resource_id.:format')`
46
47
  * If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be
47
48
  * collapsed down to a single `.`. If you need this sequence to appear and not collapse then you
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.0rc1
2
+ * @license AngularJS v1.2.0-rc.2
3
3
  * (c) 2010-2012 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -26,7 +26,12 @@ function inherit(parent, extra) {
26
26
  * @name ngRoute
27
27
  * @description
28
28
  *
29
- * Module that provides routing and deeplinking services and directives for angular apps.
29
+ * # ngRoute
30
+ *
31
+ * The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
32
+ *
33
+ * {@installModule route}
34
+ *
30
35
  */
31
36
 
32
37
  var ngRouteModule = angular.module('ngRoute', ['ng']).
@@ -40,6 +45,8 @@ var ngRouteModule = angular.module('ngRoute', ['ng']).
40
45
  * @description
41
46
  *
42
47
  * Used for configuring routes. See {@link ngRoute.$route $route} for an example.
48
+ *
49
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
43
50
  */
44
51
  function $RouteProvider(){
45
52
  var routes = {};
@@ -57,8 +64,8 @@ function $RouteProvider(){
57
64
  * * `path` can contain named groups starting with a colon (`:name`). All characters up
58
65
  * to the next slash are matched and stored in `$routeParams` under the given `name`
59
66
  * when the route matches.
60
- * * `path` can contain named groups starting with a colon and ending with a star (`:name*`).
61
- * All characters are eagerly stored in `$routeParams` under the given `name`
67
+ * * `path` can contain named groups starting with a colon and ending with a star (`:name*`).
68
+ * All characters are eagerly stored in `$routeParams` under the given `name`
62
69
  * when the route matches.
63
70
  * * `path` can contain optional named groups with a question mark (`:name?`).
64
71
  *
@@ -149,8 +156,8 @@ function $RouteProvider(){
149
156
  // create redirection for trailing slashes
150
157
  if (path) {
151
158
  var redirectPath = (path[path.length-1] == '/')
152
- ? path.substr(0, path.length-1)
153
- : path +'/';
159
+ ? path.substr(0, path.length-1)
160
+ : path +'/';
154
161
 
155
162
  routes[redirectPath] = extend(
156
163
  {redirectTo: path},
@@ -241,13 +248,15 @@ function $RouteProvider(){
241
248
  * @property {Array.<Object>} routes Array of all configured routes.
242
249
  *
243
250
  * @description
244
- * Is used for deep-linking URLs to controllers and views (HTML partials).
251
+ * `$route` is used for deep-linking URLs to controllers and views (HTML partials).
245
252
  * It watches `$location.url()` and tries to map the path to an existing route definition.
246
253
  *
254
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
255
+ *
247
256
  * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
248
257
  *
249
- * The `$route` service is typically used in conjunction with {@link ngRoute.directive:ngView ngView}
250
- * directive and the {@link ngRoute.$routeParams $routeParams} service.
258
+ * The `$route` service is typically used in conjunction with the {@link ngRoute.directive:ngView `ngView`}
259
+ * directive and the {@link ngRoute.$routeParams `$routeParams`} service.
251
260
  *
252
261
  * @example
253
262
  This example shows how changing the URL hash causes the `$route` to match a route against the
@@ -449,13 +458,12 @@ function $RouteProvider(){
449
458
  var m = route.regexp.exec(on);
450
459
  if (!m) return null;
451
460
 
452
- var N = 0;
453
461
  for (var i = 1, len = m.length; i < len; ++i) {
454
462
  var key = keys[i - 1];
455
463
 
456
464
  var val = 'string' == typeof m[i]
457
- ? decodeURIComponent(m[i])
458
- : m[i];
465
+ ? decodeURIComponent(m[i])
466
+ : m[i];
459
467
 
460
468
  if (key && val) {
461
469
  params[key.name] = val;
@@ -562,7 +570,7 @@ function $RouteProvider(){
562
570
  function interpolate(string, params) {
563
571
  var result = [];
564
572
  forEach((string||'').split(':'), function(segment, i) {
565
- if (i == 0) {
573
+ if (i === 0) {
566
574
  result.push(segment);
567
575
  } else {
568
576
  var segmentMatch = segment.match(/(\w+)(.*)/);
@@ -586,9 +594,13 @@ ngRouteModule.provider('$routeParams', $RouteParamsProvider);
586
594
  * @requires $route
587
595
  *
588
596
  * @description
589
- * Current set of route parameters. The route parameters are a combination of the
590
- * {@link ng.$location $location} `search()`, and `path()`. The `path` parameters
591
- * are extracted when the {@link ngRoute.$route $route} path is matched.
597
+ * The `$routeParams` service allows you to retrieve the current set of route parameters.
598
+ *
599
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
600
+ *
601
+ * The route parameters are a combination of {@link ng.$location `$location`}'s
602
+ * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.
603
+ * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
592
604
  *
593
605
  * In case of parameter name collision, `path` params take precedence over `search` params.
594
606
  *
@@ -613,6 +625,8 @@ function $RouteParamsProvider() {
613
625
  this.$get = function() { return {}; };
614
626
  }
615
627
 
628
+ ngRouteModule.directive('ngView', ngViewFactory);
629
+
616
630
  /**
617
631
  * @ngdoc directive
618
632
  * @name ngRoute.directive:ngView
@@ -625,6 +639,8 @@ function $RouteParamsProvider() {
625
639
  * Every time the current route changes, the included view changes with it according to the
626
640
  * configuration of the `$route` service.
627
641
  *
642
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
643
+ *
628
644
  * @animations
629
645
  * enter - animation is used to bring new content into the browser.
630
646
  * leave - animation is used to animate existing content away.
@@ -780,22 +796,18 @@ function $RouteParamsProvider() {
780
796
  * @description
781
797
  * Emitted every time the ngView content is reloaded.
782
798
  */
783
- var NG_VIEW_PRIORITY = 500;
784
- var ngViewDirective = ['$route', '$anchorScroll', '$compile', '$controller', '$animate',
785
- function($route, $anchorScroll, $compile, $controller, $animate) {
799
+ ngViewFactory.$inject = ['$route', '$anchorScroll', '$compile', '$controller', '$animate'];
800
+ function ngViewFactory( $route, $anchorScroll, $compile, $controller, $animate) {
786
801
  return {
787
802
  restrict: 'ECA',
788
803
  terminal: true,
789
- priority: NG_VIEW_PRIORITY,
790
- compile: function(element, attr) {
791
- var onloadExp = attr.onload || '';
792
-
793
- element.html('');
794
- var anchor = jqLite(document.createComment(' ngView '));
795
- element.replaceWith(anchor);
796
-
797
- return function(scope) {
798
- var currentScope, currentElement;
804
+ priority: 1000,
805
+ transclude: 'element',
806
+ compile: function(element, attr, linker) {
807
+ return function(scope, $element, attr) {
808
+ var currentScope,
809
+ currentElement,
810
+ onloadExp = attr.onload || '';
799
811
 
800
812
  scope.$on('$routeChangeSuccess', update);
801
813
  update();
@@ -816,35 +828,36 @@ var ngViewDirective = ['$route', '$anchorScroll', '$compile', '$controller', '$a
816
828
  template = locals && locals.$template;
817
829
 
818
830
  if (template) {
819
- cleanupLastView();
820
-
821
- currentScope = scope.$new();
822
- currentElement = element.clone();
823
- currentElement.html(template);
824
- $animate.enter(currentElement, null, anchor);
831
+ var newScope = scope.$new();
832
+ linker(newScope, function(clone) {
833
+ cleanupLastView();
825
834
 
826
- var link = $compile(currentElement, false, NG_VIEW_PRIORITY - 1),
827
- current = $route.current;
835
+ clone.html(template);
836
+ $animate.enter(clone, null, $element);
828
837
 
829
- if (current.controller) {
830
- locals.$scope = currentScope;
831
- var controller = $controller(current.controller, locals);
832
- if (current.controllerAs) {
833
- currentScope[current.controllerAs] = controller;
834
- }
835
- currentElement.data('$ngControllerController', controller);
836
- currentElement.children().data('$ngControllerController', controller);
837
- }
838
+ var link = $compile(clone.contents()),
839
+ current = $route.current;
838
840
 
839
- current.scope = currentScope;
841
+ currentScope = current.scope = newScope;
842
+ currentElement = clone;
840
843
 
841
- link(currentScope);
844
+ if (current.controller) {
845
+ locals.$scope = currentScope;
846
+ var controller = $controller(current.controller, locals);
847
+ if (current.controllerAs) {
848
+ currentScope[current.controllerAs] = controller;
849
+ }
850
+ clone.data('$ngControllerController', controller);
851
+ clone.contents().data('$ngControllerController', controller);
852
+ }
842
853
 
843
- currentScope.$emit('$viewContentLoaded');
844
- currentScope.$eval(onloadExp);
854
+ link(currentScope);
855
+ currentScope.$emit('$viewContentLoaded');
856
+ currentScope.$eval(onloadExp);
845
857
 
846
- // $anchorScroll might listen on event...
847
- $anchorScroll();
858
+ // $anchorScroll might listen on event...
859
+ $anchorScroll();
860
+ });
848
861
  } else {
849
862
  cleanupLastView();
850
863
  }
@@ -852,9 +865,7 @@ var ngViewDirective = ['$route', '$anchorScroll', '$compile', '$controller', '$a
852
865
  }
853
866
  }
854
867
  };
855
- }];
856
-
857
- ngRouteModule.directive('ngView', ngViewDirective);
868
+ }
858
869
 
859
870
 
860
871
  })(window, window.angular);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.0rc1
2
+ * @license AngularJS v1.2.0-rc.2
3
3
  * (c) 2010-2012 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -11,25 +11,14 @@ var $sanitizeMinErr = angular.$$minErr('$sanitize');
11
11
  * @ngdoc overview
12
12
  * @name ngSanitize
13
13
  * @description
14
- *
15
- * The `ngSanitize` module provides functionality to sanitize HTML.
16
- *
17
- * # Installation
18
- * As a separate module, it must be loaded after Angular core is loaded; otherwise, an 'Uncaught Error:
19
- * No module: ngSanitize' runtime error will occur.
20
14
  *
21
- * <pre>
22
- * <script src="angular.js"></script>
23
- * <script src="angular-sanitize.js"></script>
24
- * </pre>
15
+ * # ngSanitize
16
+ *
17
+ * The `ngSanitize` module provides functionality to sanitize HTML.
25
18
  *
26
- * # Usage
27
- * To make sure the module is available to your application, declare it as a dependency of you application
28
- * module.
19
+ * {@installModule sanitize}
29
20
  *
30
- * <pre>
31
- * angular.module('app', ['ngSanitize']);
32
- * </pre>
21
+ * See {@link ngSanitize.$sanitize `$sanitize`} for usage.
33
22
  */
34
23
 
35
24
  /*
@@ -429,8 +418,10 @@ angular.module('ngSanitize', []).value('$sanitize', $sanitize);
429
418
  * @function
430
419
  *
431
420
  * @description
432
- * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
433
- * plain email address links.
421
+ * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
422
+ * plain email address links.
423
+ *
424
+ * Requires the {@link ngSanitize `ngSanitize`} module to be installed.
434
425
  *
435
426
  * @param {string} text Input text.
436
427
  * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.
@@ -9472,7 +9472,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
9472
9472
  })( window );
9473
9473
 
9474
9474
  /**
9475
- * @license AngularJS v1.2.0rc1
9475
+ * @license AngularJS v1.2.0-rc.2
9476
9476
  * (c) 2010-2012 Google, Inc. http://angularjs.org
9477
9477
  * License: MIT
9478
9478
  */
@@ -9509,10 +9509,21 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
9509
9509
 
9510
9510
  function minErr(module) {
9511
9511
  return function () {
9512
- var prefix = '[' + (module ? module + ':' : '') + arguments[0] + '] ',
9512
+ var code = arguments[0],
9513
+ prefix = '[' + (module ? module + ':' : '') + code + '] ',
9513
9514
  template = arguments[1],
9514
9515
  templateArgs = arguments,
9515
- message;
9516
+ stringify = function (obj) {
9517
+ if (isFunction(obj)) {
9518
+ return obj.toString().replace(/ \{[\s\S]*$/, '');
9519
+ } else if (isUndefined(obj)) {
9520
+ return 'undefined';
9521
+ } else if (!isString(obj)) {
9522
+ return JSON.stringify(obj);
9523
+ }
9524
+ return obj;
9525
+ },
9526
+ message, i;
9516
9527
 
9517
9528
  message = prefix + template.replace(/\{\d+\}/g, function (match) {
9518
9529
  var index = +match.slice(1, -1), arg;
@@ -9531,6 +9542,13 @@ function minErr(module) {
9531
9542
  return match;
9532
9543
  });
9533
9544
 
9545
+ message = message + '\nhttp://errors.angularjs.org/' + version.full + '/' +
9546
+ (module ? module + '/' : '') + code;
9547
+ for (i = 2; i < arguments.length; i++) {
9548
+ message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
9549
+ encodeURIComponent(stringify(arguments[i]));
9550
+ }
9551
+
9534
9552
  return new Error(message);
9535
9553
  };
9536
9554
  }
@@ -9593,7 +9611,7 @@ if ('i' !== 'I'.toLowerCase()) {
9593
9611
 
9594
9612
 
9595
9613
  var /** holds major version number for IE or NaN for real browsers */
9596
- msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]),
9614
+ msie,
9597
9615
  jqLite, // delay binding since jQuery could be loaded after us.
9598
9616
  jQuery, // delay binding
9599
9617
  slice = [].slice,
@@ -9609,6 +9627,16 @@ var /** holds major version number for IE or NaN for real browsers */
9609
9627
  nodeName_,
9610
9628
  uid = ['0', '0', '0'];
9611
9629
 
9630
+ /**
9631
+ * IE 11 changed the format of the UserAgent string.
9632
+ * See http://msdn.microsoft.com/en-us/library/ms537503.aspx
9633
+ */
9634
+ msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
9635
+ if (isNaN(msie)) {
9636
+ msie = int((/trident\/.*; rv:(\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
9637
+ }
9638
+
9639
+
9612
9640
  /**
9613
9641
  * @private
9614
9642
  * @param {*} obj
@@ -10723,10 +10751,13 @@ function setupModuleLoader(window) {
10723
10751
  * @name angular.module
10724
10752
  * @description
10725
10753
  *
10726
- * The `angular.module` is a global place for creating and registering Angular modules. All
10727
- * modules (angular core or 3rd party) that should be available to an application must be
10754
+ * The `angular.module` is a global place for creating, registering and retrieving Angular modules.
10755
+ * All modules (angular core or 3rd party) that should be available to an application must be
10728
10756
  * registered using this mechanism.
10729
10757
  *
10758
+ * When passed two or more arguments, a new module is created. If passed only one argument, an
10759
+ * existing module (the name passed as the first argument to `module`) is retrieved.
10760
+ *
10730
10761
  *
10731
10762
  * # Module
10732
10763
  *
@@ -10997,11 +11028,11 @@ function setupModuleLoader(window) {
10997
11028
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
10998
11029
  */
10999
11030
  var version = {
11000
- full: '1.2.0rc1', // all of these placeholder strings will be replaced by grunt's
11031
+ full: '1.2.0-rc.2', // all of these placeholder strings will be replaced by grunt's
11001
11032
  major: 1, // package task
11002
11033
  minor: 2,
11003
11034
  dot: 0,
11004
- codeName: 'spooky-giraffe'
11035
+ codeName: 'barehand-atomsplitting'
11005
11036
  };
11006
11037
 
11007
11038
 
@@ -12064,13 +12095,15 @@ function annotate(fn) {
12064
12095
  if (typeof fn == 'function') {
12065
12096
  if (!($inject = fn.$inject)) {
12066
12097
  $inject = [];
12067
- fnText = fn.toString().replace(STRIP_COMMENTS, '');
12068
- argDecl = fnText.match(FN_ARGS);
12069
- forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
12070
- arg.replace(FN_ARG, function(all, underscore, name){
12071
- $inject.push(name);
12098
+ if (fn.length) {
12099
+ fnText = fn.toString().replace(STRIP_COMMENTS, '');
12100
+ argDecl = fnText.match(FN_ARGS);
12101
+ forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
12102
+ arg.replace(FN_ARG, function(all, underscore, name){
12103
+ $inject.push(name);
12104
+ });
12072
12105
  });
12073
- });
12106
+ }
12074
12107
  fn.$inject = $inject;
12075
12108
  }
12076
12109
  } else if (isArray(fn)) {
@@ -12794,7 +12827,7 @@ var $AnimateProvider = ['$provide', function($provide) {
12794
12827
  forEach(element, function(node) {
12795
12828
  parentNode.insertBefore(node, afterNextSibling);
12796
12829
  });
12797
- $timeout(done || noop, 0, false);
12830
+ done && $timeout(done, 0, false);
12798
12831
  },
12799
12832
 
12800
12833
  /**
@@ -12811,7 +12844,7 @@ var $AnimateProvider = ['$provide', function($provide) {
12811
12844
  */
12812
12845
  leave : function(element, done) {
12813
12846
  element.remove();
12814
- $timeout(done || noop, 0, false);
12847
+ done && $timeout(done, 0, false);
12815
12848
  },
12816
12849
 
12817
12850
  /**
@@ -12853,7 +12886,7 @@ var $AnimateProvider = ['$provide', function($provide) {
12853
12886
  className :
12854
12887
  isArray(className) ? className.join(' ') : '';
12855
12888
  element.addClass(className);
12856
- $timeout(done || noop, 0, false);
12889
+ done && $timeout(done, 0, false);
12857
12890
  },
12858
12891
 
12859
12892
  /**
@@ -12874,7 +12907,7 @@ var $AnimateProvider = ['$provide', function($provide) {
12874
12907
  className :
12875
12908
  isArray(className) ? className.join(' ') : '';
12876
12909
  element.removeClass(className);
12877
- $timeout(done || noop, 0, false);
12910
+ done && $timeout(done, 0, false);
12878
12911
  },
12879
12912
 
12880
12913
  enabled : noop
@@ -15173,7 +15206,7 @@ function $HttpProvider() {
15173
15206
  // strip json vulnerability protection prefix
15174
15207
  data = data.replace(PROTECTION_PREFIX, '');
15175
15208
  if (JSON_START.test(data) && JSON_END.test(data))
15176
- data = fromJson(data, true);
15209
+ data = fromJson(data);
15177
15210
  }
15178
15211
  return data;
15179
15212
  }],
@@ -15489,6 +15522,7 @@ function $HttpProvider() {
15489
15522
  * return function(promise) {
15490
15523
  * return promise.then(function(response) {
15491
15524
  * // do something on success
15525
+ * return response;
15492
15526
  * }, function(response) {
15493
15527
  * // do something on error
15494
15528
  * if (canRecover(response)) {
@@ -15968,7 +16002,7 @@ function $HttpProvider() {
15968
16002
 
15969
16003
  if (cache) {
15970
16004
  cachedResp = cache.get(url);
15971
- if (cachedResp) {
16005
+ if (isDefined(cachedResp)) {
15972
16006
  if (cachedResp.then) {
15973
16007
  // cached request has already been sent, but there is no response yet
15974
16008
  cachedResp.then(removePendingReq, removePendingReq);
@@ -15988,7 +16022,7 @@ function $HttpProvider() {
15988
16022
  }
15989
16023
 
15990
16024
  // if we won't have the response in cache, send the request to the backend
15991
- if (!cachedResp) {
16025
+ if (isUndefined(cachedResp)) {
15992
16026
  $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
15993
16027
  config.withCredentials, config.responseType);
15994
16028
  }
@@ -16238,23 +16272,32 @@ var $interpolateMinErr = minErr('$interpolate');
16238
16272
  * @description
16239
16273
  *
16240
16274
  * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
16241
- *
16275
+ *
16242
16276
  * @example
16243
- <doc:example>
16277
+ <doc:example module="customInterpolationApp">
16244
16278
  <doc:source>
16245
16279
  <script>
16246
- var myApp = angular.module('App', [], function($interpolateProvider) {
16280
+ var customInterpolationApp = angular.module('customInterpolationApp', []);
16281
+
16282
+ customInterpolationApp.config(function($interpolateProvider) {
16247
16283
  $interpolateProvider.startSymbol('//');
16248
16284
  $interpolateProvider.endSymbol('//');
16249
16285
  });
16250
- function Controller($scope) {
16251
- $scope.label = "Interpolation Provider Sample";
16252
- }
16286
+
16287
+
16288
+ customInterpolationApp.controller('DemoController', function DemoController() {
16289
+ this.label = "This bindings is brought you you by // interpolation symbols.";
16290
+ });
16253
16291
  </script>
16254
- <div ng-app="App" ng-controller="Controller">
16255
- //label//
16292
+ <div ng-app="App" ng-controller="DemoController as demo">
16293
+ //demo.label//
16256
16294
  </div>
16257
16295
  </doc:source>
16296
+ <doc:scenario>
16297
+ it('should interpolate binding with custom symbols', function() {
16298
+ expect(binding('demo.label')).toBe('This bindings is brought you you by // interpolation symbols.');
16299
+ });
16300
+ </doc:scenario>
16258
16301
  </doc:example>
16259
16302
  */
16260
16303
  function $InterpolateProvider() {
@@ -17318,7 +17361,6 @@ var $parseMinErr = minErr('$parse');
17318
17361
  // access to any member named "constructor".
17319
17362
  //
17320
17363
  // For reflective calls (a[b]) we check that the value of the lookup is not the Function constructor while evaluating
17321
- // For reflective calls (a[b]) we check that the value of the lookup is not the Function constructor while evaluating
17322
17364
  // the expression, which is a stronger but more expensive test. Since reflective calls are expensive anyway, this is not
17323
17365
  // such a big deal compared to static dereferencing.
17324
17366
  //
@@ -17992,9 +18034,21 @@ function parser(text, json, $filter, csp){
17992
18034
  }
17993
18035
  var fnPtr = fn(scope, locals, context) || noop;
17994
18036
  // IE stupidity!
17995
- return fnPtr.apply
18037
+ var v = fnPtr.apply
17996
18038
  ? fnPtr.apply(context, args)
17997
18039
  : fnPtr(args[0], args[1], args[2], args[3], args[4]);
18040
+
18041
+ // Check for promise
18042
+ if (v && v.then) {
18043
+ var p = v;
18044
+ if (!('$$v' in v)) {
18045
+ p.$$v = undefined;
18046
+ p.then(function(val) { p.$$v = val; });
18047
+ }
18048
+ v = v.$$v;
18049
+ }
18050
+
18051
+ return v;
17998
18052
  };
17999
18053
  }
18000
18054
 
@@ -18298,6 +18352,8 @@ function $ParseProvider() {
18298
18352
  * // since this fn executes async in a future turn of the event loop, we need to wrap
18299
18353
  * // our code into an $apply call so that the model changes are properly observed.
18300
18354
  * scope.$apply(function() {
18355
+ * deferred.notify('About to greet ' + name + '.');
18356
+ *
18301
18357
  * if (okToGreet(name)) {
18302
18358
  * deferred.resolve('Hello, ' + name + '!');
18303
18359
  * } else {
@@ -18314,6 +18370,8 @@ function $ParseProvider() {
18314
18370
  * alert('Success: ' + greeting);
18315
18371
  * }, function(reason) {
18316
18372
  * alert('Failed: ' + reason);
18373
+ * }, function(update) {
18374
+ * alert('Got notification: ' + update);
18317
18375
  * });
18318
18376
  * </pre>
18319
18377
  *
@@ -18332,7 +18390,8 @@ function $ParseProvider() {
18332
18390
  * A new instance of deferred is constructed by calling `$q.defer()`.
18333
18391
  *
18334
18392
  * The purpose of the deferred object is to expose the associated Promise instance as well as APIs
18335
- * that can be used for signaling the successful or unsuccessful completion of the task.
18393
+ * that can be used for signaling the successful or unsuccessful completion, as well as the status
18394
+ * of the task.
18336
18395
  *
18337
18396
  * **Methods**
18338
18397
  *
@@ -18340,6 +18399,8 @@ function $ParseProvider() {
18340
18399
  * constructed via `$q.reject`, the promise will be rejected instead.
18341
18400
  * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
18342
18401
  * resolving it with a rejection constructed via `$q.reject`.
18402
+ * - `notify(value)` - provides updates on the status of the promises execution. This may be called
18403
+ * multiple times before the promise is either resolved or rejected.
18343
18404
  *
18344
18405
  * **Properties**
18345
18406
  *
@@ -18356,12 +18417,15 @@ function $ParseProvider() {
18356
18417
  *
18357
18418
  * **Methods**
18358
18419
  *
18359
- * - `then(successCallback, errorCallback)` – regardless of when the promise was or will be resolved
18360
- * or rejected, `then` calls one of the success or error callbacks asynchronously as soon as the result
18361
- * is available. The callbacks are called with a single argument: the result or rejection reason.
18420
+ * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or
18421
+ * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously
18422
+ * as soon as the result is available. The callbacks are called with a single argument: the result
18423
+ * or rejection reason. Additionally, the notify callback may be called zero or more times to
18424
+ * provide a progress indication, before the promise is resolved or rejected.
18362
18425
  *
18363
18426
  * This method *returns a new promise* which is resolved or rejected via the return value of the
18364
- * `successCallback` or `errorCallback`.
18427
+ * `successCallback`, `errorCallback`. It also notifies via the return value of the `notifyCallback`
18428
+ * method. The promise can not be resolved or rejected from the notifyCallback method.
18365
18429
  *
18366
18430
  * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`
18367
18431
  *
@@ -18513,7 +18577,7 @@ function qFactory(nextTick, exceptionHandler) {
18513
18577
 
18514
18578
  var wrappedCallback = function(value) {
18515
18579
  try {
18516
- result.resolve((callback || defaultCallback)(value));
18580
+ result.resolve((isFunction(callback) ? callback : defaultCallback)(value));
18517
18581
  } catch(e) {
18518
18582
  result.reject(e);
18519
18583
  exceptionHandler(e);
@@ -18522,7 +18586,7 @@ function qFactory(nextTick, exceptionHandler) {
18522
18586
 
18523
18587
  var wrappedErrback = function(reason) {
18524
18588
  try {
18525
- result.resolve((errback || defaultErrback)(reason));
18589
+ result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));
18526
18590
  } catch(e) {
18527
18591
  result.reject(e);
18528
18592
  exceptionHandler(e);
@@ -18531,7 +18595,7 @@ function qFactory(nextTick, exceptionHandler) {
18531
18595
 
18532
18596
  var wrappedProgressback = function(progress) {
18533
18597
  try {
18534
- result.notify((progressback || defaultCallback)(progress));
18598
+ result.notify((isFunction(progressback) ? progressback : defaultCallback)(progress));
18535
18599
  } catch(e) {
18536
18600
  exceptionHandler(e);
18537
18601
  }
@@ -18569,7 +18633,7 @@ function qFactory(nextTick, exceptionHandler) {
18569
18633
  } catch(e) {
18570
18634
  return makePromise(e, false);
18571
18635
  }
18572
- if (callbackOutput && callbackOutput.then) {
18636
+ if (callbackOutput && isFunction(callbackOutput.then)) {
18573
18637
  return callbackOutput.then(function() {
18574
18638
  return makePromise(value, isResolved);
18575
18639
  }, function(error) {
@@ -18594,7 +18658,7 @@ function qFactory(nextTick, exceptionHandler) {
18594
18658
 
18595
18659
 
18596
18660
  var ref = function(value) {
18597
- if (value && value.then) return value;
18661
+ if (value && isFunction(value.then)) return value;
18598
18662
  return {
18599
18663
  then: function(callback) {
18600
18664
  var result = defer();
@@ -18647,7 +18711,12 @@ function qFactory(nextTick, exceptionHandler) {
18647
18711
  then: function(callback, errback) {
18648
18712
  var result = defer();
18649
18713
  nextTick(function() {
18650
- result.resolve((errback || defaultErrback)(reason));
18714
+ try {
18715
+ result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));
18716
+ } catch(e) {
18717
+ result.reject(e);
18718
+ exceptionHandler(e);
18719
+ }
18651
18720
  });
18652
18721
  return result.promise;
18653
18722
  }
@@ -18673,7 +18742,7 @@ function qFactory(nextTick, exceptionHandler) {
18673
18742
 
18674
18743
  var wrappedCallback = function(value) {
18675
18744
  try {
18676
- return (callback || defaultCallback)(value);
18745
+ return (isFunction(callback) ? callback : defaultCallback)(value);
18677
18746
  } catch (e) {
18678
18747
  exceptionHandler(e);
18679
18748
  return reject(e);
@@ -18682,7 +18751,7 @@ function qFactory(nextTick, exceptionHandler) {
18682
18751
 
18683
18752
  var wrappedErrback = function(reason) {
18684
18753
  try {
18685
- return (errback || defaultErrback)(reason);
18754
+ return (isFunction(errback) ? errback : defaultErrback)(reason);
18686
18755
  } catch (e) {
18687
18756
  exceptionHandler(e);
18688
18757
  return reject(e);
@@ -18691,7 +18760,7 @@ function qFactory(nextTick, exceptionHandler) {
18691
18760
 
18692
18761
  var wrappedProgressback = function(progress) {
18693
18762
  try {
18694
- return (progressback || defaultCallback)(progress);
18763
+ return (isFunction(progressback) ? progressback : defaultCallback)(progress);
18695
18764
  } catch (e) {
18696
18765
  exceptionHandler(e);
18697
18766
  }
@@ -18841,8 +18910,8 @@ function $RootScopeProvider(){
18841
18910
  return TTL;
18842
18911
  };
18843
18912
 
18844
- this.$get = ['$injector', '$exceptionHandler', '$parse',
18845
- function( $injector, $exceptionHandler, $parse) {
18913
+ this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser',
18914
+ function( $injector, $exceptionHandler, $parse, $browser) {
18846
18915
 
18847
18916
  /**
18848
18917
  * @ngdoc function
@@ -18891,6 +18960,7 @@ function $RootScopeProvider(){
18891
18960
  this['this'] = this.$root = this;
18892
18961
  this.$$destroyed = false;
18893
18962
  this.$$asyncQueue = [];
18963
+ this.$$postDigestQueue = [];
18894
18964
  this.$$listeners = {};
18895
18965
  this.$$isolateBindings = {};
18896
18966
  }
@@ -18905,6 +18975,7 @@ function $RootScopeProvider(){
18905
18975
 
18906
18976
 
18907
18977
  Scope.prototype = {
18978
+ constructor: Scope,
18908
18979
  /**
18909
18980
  * @ngdoc function
18910
18981
  * @name ng.$rootScope.Scope#$new
@@ -18939,6 +19010,7 @@ function $RootScopeProvider(){
18939
19010
  child.$root = this.$root;
18940
19011
  // ensure that there is just one async queue per $rootScope and it's children
18941
19012
  child.$$asyncQueue = this.$$asyncQueue;
19013
+ child.$$postDigestQueue = this.$$postDigestQueue;
18942
19014
  } else {
18943
19015
  Child = function() {}; // should be anonymous; This is so that when the minifier munges
18944
19016
  // the name it does not become random set of chars. These will then show up as class
@@ -19266,6 +19338,7 @@ function $RootScopeProvider(){
19266
19338
  var watch, value, last,
19267
19339
  watchers,
19268
19340
  asyncQueue = this.$$asyncQueue,
19341
+ postDigestQueue = this.$$postDigestQueue,
19269
19342
  length,
19270
19343
  dirty, ttl = TTL,
19271
19344
  next, current, target = this,
@@ -19338,6 +19411,14 @@ function $RootScopeProvider(){
19338
19411
  } while (dirty || asyncQueue.length);
19339
19412
 
19340
19413
  clearPhase();
19414
+
19415
+ while(postDigestQueue.length) {
19416
+ try {
19417
+ postDigestQueue.shift()();
19418
+ } catch (e) {
19419
+ $exceptionHandler(e);
19420
+ }
19421
+ }
19341
19422
  },
19342
19423
 
19343
19424
 
@@ -19438,13 +19519,16 @@ function $RootScopeProvider(){
19438
19519
  *
19439
19520
  * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only that:
19440
19521
  *
19441
- * - it will execute in the current script execution context (before any DOM rendering).
19442
- * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after
19443
- * `expression` execution.
19522
+ * - it will execute after the function that schedule the evaluation is done running (preferably before DOM rendering).
19523
+ * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after `expression` execution.
19444
19524
  *
19445
19525
  * Any exceptions from the execution of the expression are forwarded to the
19446
19526
  * {@link ng.$exceptionHandler $exceptionHandler} service.
19447
19527
  *
19528
+ * __Note:__ if this function is called outside of `$digest` cycle, a new $digest cycle will be scheduled.
19529
+ * It is however encouraged to always call code that changes the model from withing an `$apply` call.
19530
+ * That includes code evaluated via `$evalAsync`.
19531
+ *
19448
19532
  * @param {(string|function())=} expression An angular expression to be executed.
19449
19533
  *
19450
19534
  * - `string`: execute using the rules as defined in {@link guide/expression expression}.
@@ -19452,9 +19536,23 @@ function $RootScopeProvider(){
19452
19536
  *
19453
19537
  */
19454
19538
  $evalAsync: function(expr) {
19539
+ // if we are outside of an $digest loop and this is the first time we are scheduling async task also schedule
19540
+ // async auto-flush
19541
+ if (!$rootScope.$$phase && !$rootScope.$$asyncQueue.length) {
19542
+ $browser.defer(function() {
19543
+ if ($rootScope.$$asyncQueue.length) {
19544
+ $rootScope.$digest();
19545
+ }
19546
+ });
19547
+ }
19548
+
19455
19549
  this.$$asyncQueue.push(expr);
19456
19550
  },
19457
19551
 
19552
+ $$postDigest : function(expr) {
19553
+ this.$$postDigestQueue.push(expr);
19554
+ },
19555
+
19458
19556
  /**
19459
19557
  * @ngdoc function
19460
19558
  * @name ng.$rootScope.Scope#$apply
@@ -20123,7 +20221,7 @@ function $SceDelegateProvider() {
20123
20221
  * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.
20124
20222
  *
20125
20223
  * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link
20126
- * ng.$sce#parseHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly
20224
+ * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly
20127
20225
  * simplified):
20128
20226
  *
20129
20227
  * <pre class="prettyprint">
@@ -20181,7 +20279,7 @@ function $SceDelegateProvider() {
20181
20279
  * ## What trusted context types are supported?<a name="contexts"></a>
20182
20280
  *
20183
20281
  * | Context | Notes |
20184
- * |=====================|================|
20282
+ * |---------------------|----------------|
20185
20283
  * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. |
20186
20284
  * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |
20187
20285
  * | `$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. |
@@ -20692,6 +20790,7 @@ function $SnifferProvider() {
20692
20790
  this.$get = ['$window', '$document', function($window, $document) {
20693
20791
  var eventSupport = {},
20694
20792
  android = int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
20793
+ boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
20695
20794
  document = $document[0] || {},
20696
20795
  vendorPrefix,
20697
20796
  vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/,
@@ -20708,12 +20807,17 @@ function $SnifferProvider() {
20708
20807
  break;
20709
20808
  }
20710
20809
  }
20810
+
20811
+ if(!vendorPrefix) {
20812
+ vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';
20813
+ }
20814
+
20711
20815
  transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
20712
20816
  animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));
20713
-
20817
+
20714
20818
  if (android && (!transitions||!animations)) {
20715
- transitions = isString(document.body.style.webkitTransition);
20716
- animations = isString(document.body.style.webkitAnimation);
20819
+ transitions = isString(document.body.style.webkitTransition);
20820
+ animations = isString(document.body.style.webkitAnimation);
20717
20821
  }
20718
20822
  }
20719
20823
 
@@ -20723,7 +20827,10 @@ function $SnifferProvider() {
20723
20827
  // so let's not use the history API at all.
20724
20828
  // http://code.google.com/p/android/issues/detail?id=17471
20725
20829
  // https://github.com/angular/angular.js/issues/904
20726
- history: !!($window.history && $window.history.pushState && !(android < 4)),
20830
+
20831
+ // older webit browser (533.9) on Boxee box has exactly the same problem as Android has
20832
+ // so let's not use the history API also
20833
+ history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),
20727
20834
  hashchange: 'onhashchange' in $window &&
20728
20835
  // IE8 compatible mode lies
20729
20836
  (!document.documentMode || document.documentMode > 7),
@@ -20783,7 +20890,7 @@ function $TimeoutProvider() {
20783
20890
  var deferred = $q.defer(),
20784
20891
  promise = deferred.promise,
20785
20892
  skipApply = (isDefined(invokeApply) && !invokeApply),
20786
- timeoutId, cleanup;
20893
+ timeoutId;
20787
20894
 
20788
20895
  timeoutId = $browser.defer(function() {
20789
20896
  try {
@@ -20792,17 +20899,15 @@ function $TimeoutProvider() {
20792
20899
  deferred.reject(e);
20793
20900
  $exceptionHandler(e);
20794
20901
  }
20902
+ finally {
20903
+ delete deferreds[promise.$$timeoutId];
20904
+ }
20795
20905
 
20796
20906
  if (!skipApply) $rootScope.$apply();
20797
20907
  }, delay);
20798
20908
 
20799
- cleanup = function() {
20800
- delete deferreds[promise.$$timeoutId];
20801
- };
20802
-
20803
20909
  promise.$$timeoutId = timeoutId;
20804
20910
  deferreds[timeoutId] = deferred;
20805
- promise.then(cleanup, cleanup);
20806
20911
 
20807
20912
  return promise;
20808
20913
  }
@@ -20824,6 +20929,7 @@ function $TimeoutProvider() {
20824
20929
  timeout.cancel = function(promise) {
20825
20930
  if (promise && promise.$$timeoutId in deferreds) {
20826
20931
  deferreds[promise.$$timeoutId].reject('canceled');
20932
+ delete deferreds[promise.$$timeoutId];
20827
20933
  return $browser.defer.cancel(promise.$$timeoutId);
20828
20934
  }
20829
20935
  return false;
@@ -20891,7 +20997,7 @@ function $$UrlUtilsProvider() {
20891
20997
  * Otherwise, returns an object with the following members.
20892
20998
  *
20893
20999
  * | member name | Description |
20894
- * |===============|================|
21000
+ * |---------------|----------------|
20895
21001
  * | href | A normalized version of the provided URL if it was not an absolute URL |
20896
21002
  * | protocol | The protocol including the trailing colon |
20897
21003
  * | host | The host and port (if the port is non-default) of the normalizedUrl |
@@ -20899,7 +21005,7 @@ function $$UrlUtilsProvider() {
20899
21005
  * These fields from the UrlUtils interface are currently not needed and hence not returned.
20900
21006
  *
20901
21007
  * | member name | Description |
20902
- * |===============|================|
21008
+ * |---------------|----------------|
20903
21009
  * | hostname | The host without the port of the normalizedUrl |
20904
21010
  * | pathname | The path following the host in the normalizedUrl |
20905
21011
  * | hash | The URL hash if present |
@@ -20908,7 +21014,7 @@ function $$UrlUtilsProvider() {
20908
21014
  */
20909
21015
  function resolve(url, parse) {
20910
21016
  var href = url;
20911
- if (msie) {
21017
+ if (msie <= 11) {
20912
21018
  // Normalize before parse. Refer Implementation Notes on why this is
20913
21019
  // done in two steps on IE.
20914
21020
  urlParsingNode.setAttribute("href", href);
@@ -21278,7 +21384,7 @@ function filterFilter() {
21278
21384
  })();
21279
21385
  } else {
21280
21386
  (function() {
21281
- if (!expression[key]) return;
21387
+ if (typeof(expression[key]) == 'undefined') { return; }
21282
21388
  var path = key;
21283
21389
  predicates.push(function(value) {
21284
21390
  return search(getter(value,path), expression[path]);
@@ -22007,8 +22113,10 @@ function orderByFilter($parse){
22007
22113
  var t1 = typeof v1;
22008
22114
  var t2 = typeof v2;
22009
22115
  if (t1 == t2) {
22010
- if (t1 == "string") v1 = v1.toLowerCase();
22011
- if (t1 == "string") v2 = v2.toLowerCase();
22116
+ if (t1 == "string") {
22117
+ v1 = v1.toLowerCase();
22118
+ v2 = v2.toLowerCase();
22119
+ }
22012
22120
  if (v1 === v2) return 0;
22013
22121
  return v1 < v2 ? -1 : 1;
22014
22122
  } else {
@@ -24253,8 +24361,8 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
24253
24361
  var ngBindHtmlDirective = ['$sce', function($sce) {
24254
24362
  return function(scope, element, attr) {
24255
24363
  element.addClass('ng-binding').data('$binding', attr.ngBindHtml);
24256
- scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function ngBindHtmlWatchAction(value) {
24257
- element.html(value || '');
24364
+ scope.$watch(attr.ngBindHtml, function ngBindHtmlWatchAction(value) {
24365
+ element.html($sce.getTrustedHtml(value) || '');
24258
24366
  });
24259
24367
  };
24260
24368
  }];
@@ -24410,7 +24518,7 @@ function classDirective(name, selector) {
24410
24518
 
24411
24519
  ## Animations
24412
24520
 
24413
- Example that demostrates how addition and removal of classes can be animated.
24521
+ The example below demonstrates how to perform animations using ngClass.
24414
24522
 
24415
24523
  <example animations="true">
24416
24524
  <file name="index.html">
@@ -24455,6 +24563,14 @@ function classDirective(name, selector) {
24455
24563
  });
24456
24564
  </file>
24457
24565
  </example>
24566
+
24567
+
24568
+ ## ngClass and pre-existing CSS3 Transitions/Animations
24569
+ The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
24570
+ Therefore, if any CSS3 Transition/Animation styles (outside of ngAnimate) are set on the element, then, if a ngClass animation
24571
+ is triggered, the ngClass animation will be skipped so that ngAnimate can allow for the pre-existing transition or animation to
24572
+ take over. This restriction allows for ngClass to still work with standard CSS3 Transitions/Animations that are defined
24573
+ outside of ngAnimate.
24458
24574
  */
24459
24575
  var ngClassDirective = classDirective('', true);
24460
24576
 
@@ -25373,23 +25489,18 @@ var ngIfDirective = ['$animate', function($animate) {
25373
25489
  * @description
25374
25490
  * Emitted every time the ngInclude content is reloaded.
25375
25491
  */
25376
- var NG_INCLUDE_PRIORITY = 500;
25377
25492
  var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile', '$animate', '$sce',
25378
25493
  function($http, $templateCache, $anchorScroll, $compile, $animate, $sce) {
25379
25494
  return {
25380
25495
  restrict: 'ECA',
25381
25496
  terminal: true,
25382
- priority: NG_INCLUDE_PRIORITY,
25383
- compile: function(element, attr) {
25497
+ transclude: 'element',
25498
+ compile: function(element, attr, transclusion) {
25384
25499
  var srcExp = attr.ngInclude || attr.src,
25385
25500
  onloadExp = attr.onload || '',
25386
25501
  autoScrollExp = attr.autoscroll;
25387
25502
 
25388
- element.html('');
25389
- var anchor = jqLite(document.createComment(' ngInclude: ' + srcExp + ' '));
25390
- element.replaceWith(anchor);
25391
-
25392
- return function(scope) {
25503
+ return function(scope, $element) {
25393
25504
  var changeCounter = 0,
25394
25505
  currentScope,
25395
25506
  currentElement;
@@ -25413,21 +25524,23 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
25413
25524
  if (thisChangeId !== changeCounter) return;
25414
25525
  var newScope = scope.$new();
25415
25526
 
25416
- cleanupLastIncludeContent();
25527
+ transclusion(newScope, function(clone) {
25528
+ cleanupLastIncludeContent();
25417
25529
 
25418
- currentScope = newScope;
25419
- currentElement = element.clone();
25420
- currentElement.html(response);
25421
- $animate.enter(currentElement, null, anchor);
25530
+ currentScope = newScope;
25531
+ currentElement = clone;
25422
25532
 
25423
- $compile(currentElement, false, NG_INCLUDE_PRIORITY - 1)(currentScope);
25533
+ currentElement.html(response);
25534
+ $animate.enter(currentElement, null, $element);
25535
+ $compile(currentElement.contents())(currentScope);
25424
25536
 
25425
- if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
25426
- $anchorScroll();
25427
- }
25537
+ if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
25538
+ $anchorScroll();
25539
+ }
25428
25540
 
25429
- currentScope.$emit('$includeContentLoaded');
25430
- scope.$eval(onloadExp);
25541
+ currentScope.$emit('$includeContentLoaded');
25542
+ scope.$eval(onloadExp);
25543
+ });
25431
25544
  }).error(function() {
25432
25545
  if (thisChangeId === changeCounter) cleanupLastIncludeContent();
25433
25546
  });
@@ -26650,7 +26763,9 @@ var ngSwitchDefaultDirective = ngDirective({
26650
26763
  * @name ng.directive:ngTransclude
26651
26764
  *
26652
26765
  * @description
26653
- * Insert the transcluded DOM here.
26766
+ * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
26767
+ *
26768
+ * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted.
26654
26769
  *
26655
26770
  * @element ANY
26656
26771
  *
@@ -26694,16 +26809,19 @@ var ngSwitchDefaultDirective = ngDirective({
26694
26809
  *
26695
26810
  */
26696
26811
  var ngTranscludeDirective = ngDirective({
26697
- controller: ['$transclude', '$element', '$scope', function($transclude, $element, $scope) {
26698
- // use evalAsync so that we don't process transclusion before directives on the parent element even when the
26699
- // transclusion replaces the current element. (we can't use priority here because that applies only to compile fns
26700
- // and not controllers
26701
- $scope.$evalAsync(function() {
26702
- $transclude(function(clone) {
26703
- $element.append(clone);
26704
- });
26812
+ controller: ['$transclude', function($transclude) {
26813
+ // remember the transclusion fn but call it during linking so that we don't process transclusion before directives on
26814
+ // the parent element even when the transclusion replaces the current element. (we can't use priority here because
26815
+ // that applies only to compile fns and not controllers
26816
+ this.$transclude = $transclude;
26817
+ }],
26818
+
26819
+ link: function($scope, $element, $attrs, controller) {
26820
+ controller.$transclude(function(clone) {
26821
+ $element.html('');
26822
+ $element.append(clone);
26705
26823
  });
26706
- }]
26824
+ }
26707
26825
  });
26708
26826
 
26709
26827
  /**