@angular/router 6.0.0-rc.3 → 6.0.0

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.
Files changed (75) hide show
  1. package/bundles/router-testing.umd.js +54 -9
  2. package/bundles/router-testing.umd.js.map +1 -1
  3. package/bundles/router-testing.umd.min.js +5 -4
  4. package/bundles/router-testing.umd.min.js.map +1 -1
  5. package/bundles/router-upgrade.umd.js +3 -3
  6. package/bundles/router-upgrade.umd.js.map +1 -1
  7. package/bundles/router-upgrade.umd.min.js +2 -2
  8. package/bundles/router-upgrade.umd.min.js.map +1 -1
  9. package/bundles/router.umd.js +163 -78
  10. package/bundles/router.umd.js.map +1 -1
  11. package/bundles/router.umd.min.js +19 -19
  12. package/bundles/router.umd.min.js.map +1 -1
  13. package/esm2015/src/config.js +2 -2
  14. package/esm2015/src/create_router_state.js +12 -9
  15. package/esm2015/src/directives/router_link.js +3 -3
  16. package/esm2015/src/directives/router_link_active.js +2 -2
  17. package/esm2015/src/directives/router_outlet.js +2 -2
  18. package/esm2015/src/events.js +6 -6
  19. package/esm2015/src/interfaces.js +6 -6
  20. package/esm2015/src/router.js +3 -3
  21. package/esm2015/src/router_module.js +6 -6
  22. package/esm2015/src/router_outlet_context.js +3 -3
  23. package/esm2015/src/router_preloader.js +2 -2
  24. package/esm2015/src/router_state.js +5 -5
  25. package/esm2015/src/shared.js +4 -4
  26. package/esm2015/src/url_tree.js +6 -6
  27. package/esm2015/src/version.js +3 -3
  28. package/esm2015/testing/src/router_testing_module.js +4 -4
  29. package/esm5/src/config.js +1 -1
  30. package/esm5/src/create_router_state.js +12 -9
  31. package/esm5/src/directives/router_link.js +3 -3
  32. package/esm5/src/directives/router_link_active.js +2 -2
  33. package/esm5/src/directives/router_outlet.js +2 -2
  34. package/esm5/src/events.js +16 -16
  35. package/esm5/src/interfaces.js +1 -1
  36. package/esm5/src/router.js +4 -4
  37. package/esm5/src/router_module.js +5 -5
  38. package/esm5/src/router_outlet_context.js +7 -7
  39. package/esm5/src/router_preloader.js +2 -2
  40. package/esm5/src/router_state.js +13 -13
  41. package/esm5/src/shared.js +3 -3
  42. package/esm5/src/url_tree.js +16 -16
  43. package/esm5/src/version.js +3 -3
  44. package/esm5/testing/src/router_testing_module.js +4 -4
  45. package/fesm2015/router.js +46 -43
  46. package/fesm2015/router.js.map +1 -1
  47. package/fesm2015/testing.js +4 -4
  48. package/fesm2015/testing.js.map +1 -1
  49. package/fesm2015/upgrade.js +1 -1
  50. package/fesm2015/upgrade.js.map +1 -1
  51. package/fesm5/router.js +42 -39
  52. package/fesm5/router.js.map +1 -1
  53. package/fesm5/testing.js +4 -4
  54. package/fesm5/testing.js.map +1 -1
  55. package/fesm5/upgrade.js +1 -1
  56. package/fesm5/upgrade.js.map +1 -1
  57. package/package.json +7 -6
  58. package/router.metadata.json +1 -1
  59. package/src/config.d.ts +7 -7
  60. package/src/directives/router_link.d.ts +2 -2
  61. package/src/directives/router_link_active.d.ts +1 -1
  62. package/src/directives/router_outlet.d.ts +1 -1
  63. package/src/events.d.ts +6 -6
  64. package/src/interfaces.d.ts +5 -5
  65. package/src/router.d.ts +3 -3
  66. package/src/router_module.d.ts +4 -4
  67. package/src/router_outlet_context.d.ts +2 -2
  68. package/src/router_preloader.d.ts +1 -1
  69. package/src/router_state.d.ts +4 -4
  70. package/src/shared.d.ts +4 -4
  71. package/src/url_tree.d.ts +5 -5
  72. package/src/version.d.ts +1 -1
  73. package/testing/src/router_testing_module.d.ts +3 -3
  74. package/testing.d.ts +1 -1
  75. package/upgrade.d.ts +1 -1
@@ -1,14 +1,96 @@
1
1
  /**
2
- * @license Angular v6.0.0-rc.3
2
+ * @license Angular v6.0.0
3
3
  * (c) 2010-2018 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  (function (global, factory) {
8
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('tslib'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser')) :
9
- typeof define === 'function' && define.amd ? define(['exports', '@angular/common', '@angular/core', 'tslib', 'rxjs', 'rxjs/operators', '@angular/platform-browser'], factory) :
10
- (factory((global.npm_package = {}),global.ng.common,global.ng.core,global.tslib,global.rxjs,global.rxjs.operators,global.ng.platformBrowser));
11
- }(this, (function (exports,common,core,tslib_1,rxjs,operators,platformBrowser) { 'use strict';
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser')) :
9
+ typeof define === 'function' && define.amd ? define('@angular/router', ['exports', '@angular/common', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/platform-browser'], factory) :
10
+ (factory((global.ng = global.ng || {}, global.ng.router = {}),global.ng.common,global.ng.core,global.rxjs,global.rxjs.operators,global.ng.platformBrowser));
11
+ }(this, (function (exports,common,core,rxjs,operators,platformBrowser) { 'use strict';
12
+
13
+ /*! *****************************************************************************
14
+ Copyright (c) Microsoft Corporation. All rights reserved.
15
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
16
+ this file except in compliance with the License. You may obtain a copy of the
17
+ License at http://www.apache.org/licenses/LICENSE-2.0
18
+
19
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
21
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
22
+ MERCHANTABLITY OR NON-INFRINGEMENT.
23
+
24
+ See the Apache Version 2.0 License for specific language governing permissions
25
+ and limitations under the License.
26
+ ***************************************************************************** */
27
+ /* global Reflect, Promise */
28
+
29
+ var extendStatics = Object.setPrototypeOf ||
30
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
31
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
32
+
33
+ function __extends(d, b) {
34
+ extendStatics(d, b);
35
+ function __() { this.constructor = d; }
36
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
37
+ }
38
+
39
+ var __assign = Object.assign || function __assign(t) {
40
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
41
+ s = arguments[i];
42
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
43
+ }
44
+ return t;
45
+ };
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+ function __values(o) {
62
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
63
+ if (m) return m.call(o);
64
+ return {
65
+ next: function () {
66
+ if (o && i >= o.length) o = void 0;
67
+ return { value: o && o[i++], done: !o };
68
+ }
69
+ };
70
+ }
71
+
72
+ function __read(o, n) {
73
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
74
+ if (!m) return o;
75
+ var i = m.call(o), r, ar = [], e;
76
+ try {
77
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
78
+ }
79
+ catch (error) { e = { error: error }; }
80
+ finally {
81
+ try {
82
+ if (r && !r.done && (m = i["return"])) m.call(i);
83
+ }
84
+ finally { if (e) throw e.error; }
85
+ }
86
+ return ar;
87
+ }
88
+
89
+ function __spread() {
90
+ for (var ar = [], i = 0; i < arguments.length; i++)
91
+ ar = ar.concat(__read(arguments[i]));
92
+ return ar;
93
+ }
12
94
 
13
95
  /**
14
96
  * @license
@@ -51,10 +133,10 @@ var RouterEvent = /** @class */ (function () {
51
133
  *
52
134
  * Represents an event triggered when a navigation starts.
53
135
  *
54
- * @stable
136
+ *
55
137
  */
56
138
  var NavigationStart = /** @class */ (function (_super) {
57
- tslib_1.__extends(NavigationStart, _super);
139
+ __extends(NavigationStart, _super);
58
140
  function NavigationStart(/** @docsNotRequired */
59
141
  /** @docsNotRequired */
60
142
  id, /** @docsNotRequired */
@@ -84,10 +166,10 @@ var NavigationStart = /** @class */ (function (_super) {
84
166
  *
85
167
  * Represents an event triggered when a navigation ends successfully.
86
168
  *
87
- * @stable
169
+ *
88
170
  */
89
171
  var NavigationEnd = /** @class */ (function (_super) {
90
- tslib_1.__extends(NavigationEnd, _super);
172
+ __extends(NavigationEnd, _super);
91
173
  function NavigationEnd(/** @docsNotRequired */
92
174
  /** @docsNotRequired */
93
175
  id, /** @docsNotRequired */
@@ -111,10 +193,10 @@ var NavigationEnd = /** @class */ (function (_super) {
111
193
  *
112
194
  * Represents an event triggered when a navigation is canceled.
113
195
  *
114
- * @stable
196
+ *
115
197
  */
116
198
  var NavigationCancel = /** @class */ (function (_super) {
117
- tslib_1.__extends(NavigationCancel, _super);
199
+ __extends(NavigationCancel, _super);
118
200
  function NavigationCancel(/** @docsNotRequired */
119
201
  /** @docsNotRequired */
120
202
  id, /** @docsNotRequired */
@@ -136,10 +218,10 @@ var NavigationCancel = /** @class */ (function (_super) {
136
218
  *
137
219
  * Represents an event triggered when a navigation fails due to an unexpected error.
138
220
  *
139
- * @stable
221
+ *
140
222
  */
141
223
  var NavigationError = /** @class */ (function (_super) {
142
- tslib_1.__extends(NavigationError, _super);
224
+ __extends(NavigationError, _super);
143
225
  function NavigationError(/** @docsNotRequired */
144
226
  /** @docsNotRequired */
145
227
  id, /** @docsNotRequired */
@@ -163,10 +245,10 @@ var NavigationError = /** @class */ (function (_super) {
163
245
  *
164
246
  * Represents an event triggered when routes are recognized.
165
247
  *
166
- * @stable
248
+ *
167
249
  */
168
250
  var RoutesRecognized = /** @class */ (function (_super) {
169
- tslib_1.__extends(RoutesRecognized, _super);
251
+ __extends(RoutesRecognized, _super);
170
252
  function RoutesRecognized(/** @docsNotRequired */
171
253
  /** @docsNotRequired */
172
254
  id, /** @docsNotRequired */
@@ -195,7 +277,7 @@ var RoutesRecognized = /** @class */ (function (_super) {
195
277
  * @experimental
196
278
  */
197
279
  var GuardsCheckStart = /** @class */ (function (_super) {
198
- tslib_1.__extends(GuardsCheckStart, _super);
280
+ __extends(GuardsCheckStart, _super);
199
281
  function GuardsCheckStart(/** @docsNotRequired */
200
282
  /** @docsNotRequired */
201
283
  id, /** @docsNotRequired */
@@ -221,7 +303,7 @@ var GuardsCheckStart = /** @class */ (function (_super) {
221
303
  * @experimental
222
304
  */
223
305
  var GuardsCheckEnd = /** @class */ (function (_super) {
224
- tslib_1.__extends(GuardsCheckEnd, _super);
306
+ __extends(GuardsCheckEnd, _super);
225
307
  function GuardsCheckEnd(/** @docsNotRequired */
226
308
  /** @docsNotRequired */
227
309
  id, /** @docsNotRequired */
@@ -252,7 +334,7 @@ var GuardsCheckEnd = /** @class */ (function (_super) {
252
334
  * @experimental
253
335
  */
254
336
  var ResolveStart = /** @class */ (function (_super) {
255
- tslib_1.__extends(ResolveStart, _super);
337
+ __extends(ResolveStart, _super);
256
338
  function ResolveStart(/** @docsNotRequired */
257
339
  /** @docsNotRequired */
258
340
  id, /** @docsNotRequired */
@@ -279,7 +361,7 @@ var ResolveStart = /** @class */ (function (_super) {
279
361
  * @experimental
280
362
  */
281
363
  var ResolveEnd = /** @class */ (function (_super) {
282
- tslib_1.__extends(ResolveEnd, _super);
364
+ __extends(ResolveEnd, _super);
283
365
  function ResolveEnd(/** @docsNotRequired */
284
366
  /** @docsNotRequired */
285
367
  id, /** @docsNotRequired */
@@ -416,7 +498,7 @@ var ActivationEnd = /** @class */ (function () {
416
498
  *
417
499
  * Name of the primary outlet.
418
500
  *
419
- * @stable
501
+ *
420
502
  */
421
503
  var PRIMARY_OUTLET = 'primary';
422
504
  var ParamsAsMap = /** @class */ (function () {
@@ -448,7 +530,7 @@ var ParamsAsMap = /** @class */ (function () {
448
530
  /**
449
531
  * Convert a `Params` instance to a `ParamMap`.
450
532
  *
451
- * @stable
533
+ *
452
534
  */
453
535
  function convertToParamMap(params) {
454
536
  return new ParamsAsMap(params);
@@ -578,7 +660,7 @@ function getFullPath(parentPath, currentRoute) {
578
660
  }
579
661
  function copyConfig(r) {
580
662
  var children = r.children && r.children.map(copyConfig);
581
- return children ? tslib_1.__assign({}, r, { children: children }) : tslib_1.__assign({}, r);
663
+ return children ? __assign({}, r, { children: children }) : __assign({}, r);
582
664
  }
583
665
 
584
666
  /**
@@ -772,7 +854,7 @@ function containsSegmentGroupHelper(container, containee, containeePaths) {
772
854
  * }
773
855
  * ```
774
856
  *
775
- * @stable
857
+ *
776
858
  */
777
859
  var UrlTree = /** @class */ (function () {
778
860
  /** @internal */
@@ -807,7 +889,7 @@ var UrlTree = /** @class */ (function () {
807
889
  *
808
890
  * See `UrlTree` for more information.
809
891
  *
810
- * @stable
892
+ *
811
893
  */
812
894
  var UrlSegmentGroup = /** @class */ (function () {
813
895
  function UrlSegmentGroup(/** The URL segments of this group. See `UrlSegment` for more information */
@@ -860,7 +942,7 @@ var UrlSegmentGroup = /** @class */ (function () {
860
942
  * }
861
943
  * ```
862
944
  *
863
- * @stable
945
+ *
864
946
  */
865
947
  var UrlSegment = /** @class */ (function () {
866
948
  function UrlSegment(/** The path part of a URL segment */
@@ -917,7 +999,7 @@ function mapChildrenIntoArray(segment, fn) {
917
999
  *
918
1000
  * See `DefaultUrlSerializer` for an example of a URL serializer.
919
1001
  *
920
- * @stable
1002
+ *
921
1003
  */
922
1004
  var UrlSerializer = /** @class */ (function () {
923
1005
  function UrlSerializer() {
@@ -940,7 +1022,7 @@ var UrlSerializer = /** @class */ (function () {
940
1022
  * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to
941
1023
  * specify route specific parameters.
942
1024
  *
943
- * @stable
1025
+ *
944
1026
  */
945
1027
  var DefaultUrlSerializer = /** @class */ (function () {
946
1028
  function DefaultUrlSerializer() {
@@ -1363,7 +1445,7 @@ var ApplyRedirects = /** @class */ (function () {
1363
1445
  };
1364
1446
  ApplyRedirects.prototype.expandSegment = function (ngModule, segmentGroup, routes, segments, outlet, allowRedirects) {
1365
1447
  var _this = this;
1366
- return rxjs.of.apply(void 0, tslib_1.__spread(routes)).pipe(operators.map(function (r) {
1448
+ return rxjs.of.apply(void 0, __spread(routes)).pipe(operators.map(function (r) {
1367
1449
  var expanded$ = _this.expandSegmentAgainstRoute(ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);
1368
1450
  return expanded$.pipe(operators.catchError(function (e) {
1369
1451
  if (e instanceof NoMatch) {
@@ -1546,7 +1628,7 @@ var ApplyRedirects = /** @class */ (function () {
1546
1628
  ApplyRedirects.prototype.findOrReturn = function (redirectToUrlSegment, actualSegments) {
1547
1629
  var idx = 0;
1548
1630
  try {
1549
- for (var actualSegments_1 = tslib_1.__values(actualSegments), actualSegments_1_1 = actualSegments_1.next(); !actualSegments_1_1.done; actualSegments_1_1 = actualSegments_1.next()) {
1631
+ for (var actualSegments_1 = __values(actualSegments), actualSegments_1_1 = actualSegments_1.next(); !actualSegments_1_1.done; actualSegments_1_1 = actualSegments_1.next()) {
1550
1632
  var s = actualSegments_1_1.value;
1551
1633
  if (s.path === redirectToUrlSegment.path) {
1552
1634
  actualSegments.splice(idx);
@@ -1624,7 +1706,7 @@ function mergeTrivialChildren(s) {
1624
1706
  function addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {
1625
1707
  var res = {};
1626
1708
  try {
1627
- for (var routes_1 = tslib_1.__values(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
1709
+ for (var routes_1 = __values(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
1628
1710
  var r = routes_1_1.value;
1629
1711
  if (isEmptyPathRedirect(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {
1630
1712
  res[getOutlet(r)] = new UrlSegmentGroup([], {});
@@ -1638,14 +1720,14 @@ function addEmptySegmentsToChildrenIfNeeded(segmentGroup, slicedSegments, routes
1638
1720
  }
1639
1721
  finally { if (e_2) throw e_2.error; }
1640
1722
  }
1641
- return tslib_1.__assign({}, children, res);
1723
+ return __assign({}, children, res);
1642
1724
  var e_2, _a;
1643
1725
  }
1644
1726
  function createChildrenForEmptySegments(routes, primarySegmentGroup) {
1645
1727
  var res = {};
1646
1728
  res[PRIMARY_OUTLET] = primarySegmentGroup;
1647
1729
  try {
1648
- for (var routes_2 = tslib_1.__values(routes), routes_2_1 = routes_2.next(); !routes_2_1.done; routes_2_1 = routes_2.next()) {
1730
+ for (var routes_2 = __values(routes), routes_2_1 = routes_2.next(); !routes_2_1.done; routes_2_1 = routes_2.next()) {
1649
1731
  var r = routes_2_1.value;
1650
1732
  if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {
1651
1733
  res[getOutlet(r)] = new UrlSegmentGroup([], {});
@@ -1766,7 +1848,7 @@ function findNode(value, node) {
1766
1848
  if (value === node.value)
1767
1849
  return node;
1768
1850
  try {
1769
- for (var _a = tslib_1.__values(node.children), _b = _a.next(); !_b.done; _b = _a.next()) {
1851
+ for (var _a = __values(node.children), _b = _a.next(); !_b.done; _b = _a.next()) {
1770
1852
  var child = _b.value;
1771
1853
  var node_1 = findNode(value, child);
1772
1854
  if (node_1)
@@ -1788,7 +1870,7 @@ function findPath(value, node) {
1788
1870
  if (value === node.value)
1789
1871
  return [node];
1790
1872
  try {
1791
- for (var _a = tslib_1.__values(node.children), _b = _a.next(); !_b.done; _b = _a.next()) {
1873
+ for (var _a = __values(node.children), _b = _a.next(); !_b.done; _b = _a.next()) {
1792
1874
  var child = _b.value;
1793
1875
  var path = findPath(value, child);
1794
1876
  if (path.length) {
@@ -1856,10 +1938,10 @@ function nodeChildrenAsMap(node) {
1856
1938
  *
1857
1939
  * See `ActivatedRoute` for more information.
1858
1940
  *
1859
- * @stable
1941
+ *
1860
1942
  */
1861
1943
  var RouterState = /** @class */ (function (_super) {
1862
- tslib_1.__extends(RouterState, _super);
1944
+ __extends(RouterState, _super);
1863
1945
  /** @internal */
1864
1946
  function RouterState(root, /** The current snapshot of the router state */
1865
1947
  snapshot) {
@@ -1908,7 +1990,7 @@ function createEmptyStateSnapshot(urlTree, rootComponent) {
1908
1990
  * }
1909
1991
  * ```
1910
1992
  *
1911
- * @stable
1993
+ *
1912
1994
  */
1913
1995
  var ActivatedRoute = /** @class */ (function () {
1914
1996
  /** @internal */
@@ -2030,9 +2112,9 @@ function inheritedParamsDataResolve(route, paramsInheritanceStrategy) {
2030
2112
  /** @internal */
2031
2113
  function flattenInherited(pathFromRoot) {
2032
2114
  return pathFromRoot.reduce(function (res, curr) {
2033
- var params = tslib_1.__assign({}, res.params, curr.params);
2034
- var data = tslib_1.__assign({}, res.data, curr.data);
2035
- var resolve = tslib_1.__assign({}, res.resolve, curr._resolvedData);
2115
+ var params = __assign({}, res.params, curr.params);
2116
+ var data = __assign({}, res.data, curr.data);
2117
+ var resolve = __assign({}, res.resolve, curr._resolvedData);
2036
2118
  return { params: params, data: data, resolve: resolve };
2037
2119
  }, { params: {}, data: {}, resolve: {} });
2038
2120
  }
@@ -2054,7 +2136,7 @@ function flattenInherited(pathFromRoot) {
2054
2136
  * }
2055
2137
  * ```
2056
2138
  *
2057
- * @stable
2139
+ *
2058
2140
  */
2059
2141
  var ActivatedRouteSnapshot = /** @class */ (function () {
2060
2142
  /** @internal */
@@ -2164,10 +2246,10 @@ var ActivatedRouteSnapshot = /** @class */ (function () {
2164
2246
  * }
2165
2247
  * ```
2166
2248
  *
2167
- * @stable
2249
+ *
2168
2250
  */
2169
2251
  var RouterStateSnapshot = /** @class */ (function (_super) {
2170
- tslib_1.__extends(RouterStateSnapshot, _super);
2252
+ __extends(RouterStateSnapshot, _super);
2171
2253
  /** @internal */
2172
2254
  function RouterStateSnapshot(/** The url from which this snapshot was created */
2173
2255
  url, root) {
@@ -2247,15 +2329,18 @@ function createNode(routeReuseStrategy, curr, prevState) {
2247
2329
  return new TreeNode(value, children);
2248
2330
  // retrieve an activated route that is used to be displayed, but is not currently displayed
2249
2331
  }
2250
- else if (routeReuseStrategy.retrieve(curr.value)) {
2251
- var tree = routeReuseStrategy.retrieve(curr.value).route;
2252
- setFutureSnapshotsOfActivatedRoutes(curr, tree);
2253
- return tree;
2254
- }
2255
2332
  else {
2256
- var value = createActivatedRoute(curr.value);
2257
- var children = curr.children.map(function (c) { return createNode(routeReuseStrategy, c); });
2258
- return new TreeNode(value, children);
2333
+ var detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);
2334
+ if (detachedRouteHandle) {
2335
+ var tree = detachedRouteHandle.route;
2336
+ setFutureSnapshotsOfActivatedRoutes(curr, tree);
2337
+ return tree;
2338
+ }
2339
+ else {
2340
+ var value = createActivatedRoute(curr.value);
2341
+ var children = curr.children.map(function (c) { return createNode(routeReuseStrategy, c); });
2342
+ return new TreeNode(value, children);
2343
+ }
2259
2344
  }
2260
2345
  }
2261
2346
  function setFutureSnapshotsOfActivatedRoutes(curr, result) {
@@ -2273,7 +2358,7 @@ function setFutureSnapshotsOfActivatedRoutes(curr, result) {
2273
2358
  function createOrReuseChildren(routeReuseStrategy, curr, prevState) {
2274
2359
  return curr.children.map(function (child) {
2275
2360
  try {
2276
- for (var _a = tslib_1.__values(prevState.children), _b = _a.next(); !_b.done; _b = _a.next()) {
2361
+ for (var _a = __values(prevState.children), _b = _a.next(); !_b.done; _b = _a.next()) {
2277
2362
  var p = _b.value;
2278
2363
  if (routeReuseStrategy.shouldReuseRoute(p.value.snapshot, child.value)) {
2279
2364
  return createNode(routeReuseStrategy, child, p);
@@ -2375,14 +2460,14 @@ function computeNavigation(commands) {
2375
2460
  forEach(cmd.outlets, function (commands, name) {
2376
2461
  outlets_1[name] = typeof commands === 'string' ? commands.split('/') : commands;
2377
2462
  });
2378
- return tslib_1.__spread(res, [{ outlets: outlets_1 }]);
2463
+ return __spread(res, [{ outlets: outlets_1 }]);
2379
2464
  }
2380
2465
  if (cmd.segmentPath) {
2381
- return tslib_1.__spread(res, [cmd.segmentPath]);
2466
+ return __spread(res, [cmd.segmentPath]);
2382
2467
  }
2383
2468
  }
2384
2469
  if (!(typeof cmd === 'string')) {
2385
- return tslib_1.__spread(res, [cmd]);
2470
+ return __spread(res, [cmd]);
2386
2471
  }
2387
2472
  if (cmdIdx === 0) {
2388
2473
  cmd.split('/').forEach(function (urlPart, partIndex) {
@@ -2403,7 +2488,7 @@ function computeNavigation(commands) {
2403
2488
  });
2404
2489
  return res;
2405
2490
  }
2406
- return tslib_1.__spread(res, [cmd]);
2491
+ return __spread(res, [cmd]);
2407
2492
  }, []);
2408
2493
  return new Navigation(isAbsolute, numberOfDoubleDots, res);
2409
2494
  }
@@ -2892,7 +2977,7 @@ var PreActivation = /** @class */ (function () {
2892
2977
  var resolve = future._resolve;
2893
2978
  return this.resolveNode(resolve, future).pipe(operators.map(function (resolvedData) {
2894
2979
  future._resolvedData = resolvedData;
2895
- future.data = tslib_1.__assign({}, future.data, inheritedParamsDataResolve(future, paramsInheritanceStrategy).resolve);
2980
+ future.data = __assign({}, future.data, inheritedParamsDataResolve(future, paramsInheritanceStrategy).resolve);
2896
2981
  return null;
2897
2982
  }));
2898
2983
  };
@@ -3003,7 +3088,7 @@ var Recognizer = /** @class */ (function () {
3003
3088
  };
3004
3089
  Recognizer.prototype.processSegment = function (config, segmentGroup, segments, outlet) {
3005
3090
  try {
3006
- for (var config_1 = tslib_1.__values(config), config_1_1 = config_1.next(); !config_1_1.done; config_1_1 = config_1.next()) {
3091
+ for (var config_1 = __values(config), config_1_1 = config_1.next(); !config_1_1.done; config_1_1 = config_1.next()) {
3007
3092
  var r = config_1_1.value;
3008
3093
  try {
3009
3094
  return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);
@@ -3093,7 +3178,7 @@ function match$1(segmentGroup, route, segments) {
3093
3178
  throw new NoMatch$1();
3094
3179
  var posParams = {};
3095
3180
  forEach((res.posParams), function (v, k) { posParams[k] = v.path; });
3096
- var parameters = res.consumed.length > 0 ? tslib_1.__assign({}, posParams, res.consumed[res.consumed.length - 1].parameters) :
3181
+ var parameters = res.consumed.length > 0 ? __assign({}, posParams, res.consumed[res.consumed.length - 1].parameters) :
3097
3182
  posParams;
3098
3183
  return { consumedSegments: res.consumed, lastChild: res.consumed.length, parameters: parameters };
3099
3184
  }
@@ -3148,7 +3233,7 @@ function split$1(segmentGroup, consumedSegments, slicedSegments, config) {
3148
3233
  function addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, children) {
3149
3234
  var res = {};
3150
3235
  try {
3151
- for (var routes_1 = tslib_1.__values(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
3236
+ for (var routes_1 = __values(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
3152
3237
  var r = routes_1_1.value;
3153
3238
  if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet$1(r)]) {
3154
3239
  var s = new UrlSegmentGroup([], {});
@@ -3165,7 +3250,7 @@ function addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, routes, c
3165
3250
  }
3166
3251
  finally { if (e_2) throw e_2.error; }
3167
3252
  }
3168
- return tslib_1.__assign({}, children, res);
3253
+ return __assign({}, children, res);
3169
3254
  var e_2, _a;
3170
3255
  }
3171
3256
  function createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, primarySegment) {
@@ -3174,7 +3259,7 @@ function createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, pri
3174
3259
  primarySegment._sourceSegment = segmentGroup;
3175
3260
  primarySegment._segmentIndexShift = consumedSegments.length;
3176
3261
  try {
3177
- for (var routes_2 = tslib_1.__values(routes), routes_2_1 = routes_2.next(); !routes_2_1.done; routes_2_1 = routes_2.next()) {
3262
+ for (var routes_2 = __values(routes), routes_2_1 = routes_2.next(); !routes_2_1.done; routes_2_1 = routes_2.next()) {
3178
3263
  var r = routes_2_1.value;
3179
3264
  if (r.path === '' && getOutlet$1(r) !== PRIMARY_OUTLET) {
3180
3265
  var s = new UrlSegmentGroup([], {});
@@ -3359,7 +3444,7 @@ function defaultRouterHook(snapshot) {
3359
3444
  *
3360
3445
  * @ngModule RouterModule
3361
3446
  *
3362
- * @stable
3447
+ *
3363
3448
  */
3364
3449
  var Router = /** @class */ (function () {
3365
3450
  /**
@@ -3692,7 +3777,7 @@ var Router = /** @class */ (function () {
3692
3777
  if (queryParamsHandling) {
3693
3778
  switch (queryParamsHandling) {
3694
3779
  case 'merge':
3695
- q = tslib_1.__assign({}, this.currentUrlTree.queryParams, queryParams);
3780
+ q = __assign({}, this.currentUrlTree.queryParams, queryParams);
3696
3781
  break;
3697
3782
  case 'preserve':
3698
3783
  q = this.currentUrlTree.queryParams;
@@ -4380,7 +4465,7 @@ function validateCommands(commands) {
4380
4465
  *
4381
4466
  * @ngModule RouterModule
4382
4467
  *
4383
- * @stable
4468
+ *
4384
4469
  */
4385
4470
  var RouterLink = /** @class */ (function () {
4386
4471
  function RouterLink(router, route, tabIndex, renderer, el) {
@@ -4471,7 +4556,7 @@ var RouterLink = /** @class */ (function () {
4471
4556
  *
4472
4557
  * @ngModule RouterModule
4473
4558
  *
4474
- * @stable
4559
+ *
4475
4560
  */
4476
4561
  var RouterLinkWithHref = /** @class */ (function () {
4477
4562
  function RouterLinkWithHref(router, route, locationStrategy) {
@@ -4631,7 +4716,7 @@ function attrBoolValue(s) {
4631
4716
  *
4632
4717
  * @ngModule RouterModule
4633
4718
  *
4634
- * @stable
4719
+ *
4635
4720
  */
4636
4721
  var RouterLinkActive = /** @class */ (function () {
4637
4722
  function RouterLinkActive(router, element, renderer, cdr) {
@@ -4726,7 +4811,7 @@ var RouterLinkActive = /** @class */ (function () {
4726
4811
  /**
4727
4812
  * Store contextual information about a `RouterOutlet`
4728
4813
  *
4729
- * @stable
4814
+ *
4730
4815
  */
4731
4816
  var OutletContext = /** @class */ (function () {
4732
4817
  function OutletContext() {
@@ -4741,7 +4826,7 @@ var OutletContext = /** @class */ (function () {
4741
4826
  /**
4742
4827
  * Store contextual information about the children (= nested) `RouterOutlet`
4743
4828
  *
4744
- * @stable
4829
+ *
4745
4830
  */
4746
4831
  var ChildrenOutletContexts = /** @class */ (function () {
4747
4832
  function ChildrenOutletContexts() {
@@ -4835,7 +4920,7 @@ var ChildrenOutletContexts = /** @class */ (function () {
4835
4920
  * ```
4836
4921
  * @ngModule RouterModule
4837
4922
  *
4838
- * @stable
4923
+ *
4839
4924
  */
4840
4925
  var RouterOutlet = /** @class */ (function () {
4841
4926
  function RouterOutlet(parentContexts, location, resolver, name, changeDetector) {
@@ -5057,7 +5142,7 @@ var NoPreloading = /** @class */ (function () {
5057
5142
  *
5058
5143
  * If a route is protected by `canLoad` guards, the preloaded will not load it.
5059
5144
  *
5060
- * @stable
5145
+ *
5061
5146
  */
5062
5147
  var RouterPreloader = /** @class */ (function () {
5063
5148
  function RouterPreloader(router, moduleLoader, compiler, injector, preloadingStrategy) {
@@ -5093,7 +5178,7 @@ var RouterPreloader = /** @class */ (function () {
5093
5178
  RouterPreloader.prototype.processRoutes = function (ngModule, routes) {
5094
5179
  var res = [];
5095
5180
  try {
5096
- for (var routes_1 = tslib_1.__values(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
5181
+ for (var routes_1 = __values(routes), routes_1_1 = routes_1.next(); !routes_1_1.done; routes_1_1 = routes_1.next()) {
5097
5182
  var route = routes_1_1.value;
5098
5183
  // we already have the config loaded, just recurse
5099
5184
  if (route.loadChildren && !route.canLoad && route._loadedConfig) {
@@ -5156,7 +5241,7 @@ var RouterPreloader = /** @class */ (function () {
5156
5241
  *
5157
5242
  * Contains a list of directives
5158
5243
  *
5159
- * @stable
5244
+ *
5160
5245
  */
5161
5246
  var ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive];
5162
5247
  /**
@@ -5164,7 +5249,7 @@ var ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLin
5164
5249
  *
5165
5250
  * Is used in DI to configure the router.
5166
5251
  *
5167
- * @stable
5252
+ *
5168
5253
  */
5169
5254
  var ROUTER_CONFIGURATION = new core.InjectionToken('ROUTER_CONFIGURATION');
5170
5255
  /**
@@ -5243,7 +5328,7 @@ function routerNgProbeToken() {
5243
5328
  * [Read this developer guide](https://angular.io/docs/ts/latest/guide/router.html) to get an
5244
5329
  * overview of how the router should be used.
5245
5330
  *
5246
- * @stable
5331
+ *
5247
5332
  */
5248
5333
  var RouterModule = /** @class */ (function () {
5249
5334
  // Note: We are injecting the Router so it gets created eagerly...
@@ -5368,7 +5453,7 @@ function provideForRootGuard(router) {
5368
5453
  * class MyNgModule {}
5369
5454
  * ```
5370
5455
  *
5371
- * @stable
5456
+ *
5372
5457
  */
5373
5458
  function provideRoutes(routes) {
5374
5459
  return [
@@ -5530,9 +5615,9 @@ function provideRouterInitializer() {
5530
5615
  * found in the LICENSE file at https://angular.io/license
5531
5616
  */
5532
5617
  /**
5533
- * @stable
5618
+ *
5534
5619
  */
5535
- var VERSION = new core.Version('6.0.0-rc.3');
5620
+ var VERSION = new core.Version('6.0.0');
5536
5621
 
5537
5622
  /**
5538
5623
  * @license