@angular/router 7.1.3 → 7.1.4

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 (121) hide show
  1. package/bundles/router-testing.umd.js +1 -1
  2. package/bundles/router-testing.umd.min.js +1 -1
  3. package/bundles/router-testing.umd.min.js.map +1 -1
  4. package/bundles/router-upgrade.umd.js +1 -1
  5. package/bundles/router-upgrade.umd.min.js +1 -1
  6. package/bundles/router-upgrade.umd.min.js.map +1 -1
  7. package/bundles/router.umd.js +2 -2
  8. package/bundles/router.umd.js.map +1 -1
  9. package/bundles/router.umd.min.js +2 -2
  10. package/bundles/router.umd.min.js.map +1 -1
  11. package/esm2015/index.js +1 -2
  12. package/esm2015/public_api.js +1 -3
  13. package/esm2015/router.externs.js +7 -3
  14. package/esm2015/router.js +0 -1
  15. package/esm2015/src/apply_redirects.js +15 -15
  16. package/esm2015/src/components/empty_outlet.js +1 -2
  17. package/esm2015/src/config.js +40 -66
  18. package/esm2015/src/create_router_state.js +3 -4
  19. package/esm2015/src/create_url_tree.js +3 -6
  20. package/esm2015/src/directives/router_link.js +4 -5
  21. package/esm2015/src/directives/router_link_active.js +3 -4
  22. package/esm2015/src/directives/router_outlet.js +6 -5
  23. package/esm2015/src/events.js +43 -33
  24. package/esm2015/src/index.js +1 -2
  25. package/esm2015/src/interfaces.js +44 -25
  26. package/esm2015/src/operators/activate_routes.js +8 -5
  27. package/esm2015/src/operators/apply_redirects.js +2 -3
  28. package/esm2015/src/operators/check_guards.js +8 -9
  29. package/esm2015/src/operators/prioritized_guard_value.js +4 -6
  30. package/esm2015/src/operators/recognize.js +2 -3
  31. package/esm2015/src/operators/resolve_data.js +3 -4
  32. package/esm2015/src/operators/switch_tap.js +2 -3
  33. package/esm2015/src/private_export.js +1 -2
  34. package/esm2015/src/recognize.js +16 -15
  35. package/esm2015/src/route_reuse_strategy.js +2 -9
  36. package/esm2015/src/router.js +155 -164
  37. package/esm2015/src/router_config_loader.js +7 -6
  38. package/esm2015/src/router_module.js +188 -185
  39. package/esm2015/src/router_outlet_context.js +3 -3
  40. package/esm2015/src/router_preloader.js +5 -3
  41. package/esm2015/src/router_scroller.js +2 -3
  42. package/esm2015/src/router_state.js +12 -19
  43. package/esm2015/src/shared.js +38 -33
  44. package/esm2015/src/url_handling_strategy.js +2 -3
  45. package/esm2015/src/url_tree.js +14 -5
  46. package/esm2015/src/utils/collection.js +2 -3
  47. package/esm2015/src/utils/preactivation.js +4 -5
  48. package/esm2015/src/utils/tree.js +5 -3
  49. package/esm2015/src/utils/type_guards.js +2 -3
  50. package/esm2015/src/version.js +11 -6
  51. package/esm2015/testing/index.js +1 -2
  52. package/esm2015/testing/public_api.js +1 -3
  53. package/esm2015/testing/src/router_testing_module.js +4 -5
  54. package/esm2015/testing/src/testing.js +1 -2
  55. package/esm2015/testing/testing.js +0 -1
  56. package/esm2015/upgrade/index.js +1 -2
  57. package/esm2015/upgrade/public_api.js +1 -3
  58. package/esm2015/upgrade/src/upgrade.js +9 -8
  59. package/esm2015/upgrade/upgrade.js +0 -1
  60. package/esm5/index.js +0 -1
  61. package/esm5/public_api.js +0 -1
  62. package/esm5/router.js +0 -1
  63. package/esm5/src/apply_redirects.js +0 -1
  64. package/esm5/src/components/empty_outlet.js +0 -1
  65. package/esm5/src/config.js +0 -1
  66. package/esm5/src/create_router_state.js +0 -1
  67. package/esm5/src/create_url_tree.js +0 -1
  68. package/esm5/src/directives/router_link.js +0 -1
  69. package/esm5/src/directives/router_link_active.js +0 -1
  70. package/esm5/src/directives/router_outlet.js +0 -1
  71. package/esm5/src/events.js +0 -1
  72. package/esm5/src/index.js +0 -1
  73. package/esm5/src/interfaces.js +0 -1
  74. package/esm5/src/operators/activate_routes.js +0 -1
  75. package/esm5/src/operators/apply_redirects.js +0 -1
  76. package/esm5/src/operators/check_guards.js +0 -1
  77. package/esm5/src/operators/prioritized_guard_value.js +0 -1
  78. package/esm5/src/operators/recognize.js +0 -1
  79. package/esm5/src/operators/resolve_data.js +0 -1
  80. package/esm5/src/operators/switch_tap.js +0 -1
  81. package/esm5/src/private_export.js +0 -1
  82. package/esm5/src/recognize.js +0 -1
  83. package/esm5/src/route_reuse_strategy.js +0 -1
  84. package/esm5/src/router.js +0 -1
  85. package/esm5/src/router_config_loader.js +0 -1
  86. package/esm5/src/router_module.js +0 -1
  87. package/esm5/src/router_outlet_context.js +0 -1
  88. package/esm5/src/router_preloader.js +0 -1
  89. package/esm5/src/router_scroller.js +0 -1
  90. package/esm5/src/router_state.js +0 -1
  91. package/esm5/src/shared.js +0 -1
  92. package/esm5/src/url_handling_strategy.js +0 -1
  93. package/esm5/src/url_tree.js +0 -1
  94. package/esm5/src/utils/collection.js +0 -1
  95. package/esm5/src/utils/preactivation.js +0 -1
  96. package/esm5/src/utils/tree.js +0 -1
  97. package/esm5/src/utils/type_guards.js +0 -1
  98. package/esm5/src/version.js +1 -2
  99. package/esm5/testing/index.js +0 -1
  100. package/esm5/testing/public_api.js +0 -1
  101. package/esm5/testing/src/router_testing_module.js +0 -1
  102. package/esm5/testing/src/testing.js +0 -1
  103. package/esm5/testing/testing.js +0 -1
  104. package/esm5/upgrade/index.js +0 -1
  105. package/esm5/upgrade/public_api.js +0 -1
  106. package/esm5/upgrade/src/upgrade.js +0 -1
  107. package/esm5/upgrade/upgrade.js +0 -1
  108. package/fesm2015/router.js +241 -182
  109. package/fesm2015/router.js.map +1 -1
  110. package/fesm2015/testing.js +7 -8
  111. package/fesm2015/testing.js.map +1 -1
  112. package/fesm2015/upgrade.js +11 -10
  113. package/fesm2015/upgrade.js.map +1 -1
  114. package/fesm5/router.js +2 -2
  115. package/fesm5/router.js.map +1 -1
  116. package/fesm5/testing.js +1 -1
  117. package/fesm5/upgrade.js +1 -1
  118. package/package.json +4 -4
  119. package/router.metadata.json +1 -1
  120. package/testing.d.ts +1 -1
  121. package/upgrade.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v7.1.3
2
+ * @license Angular v7.1.4
3
3
  * (c) 2010-2018 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -12,7 +12,14 @@ import { ɵgetDOM } from '@angular/platform-browser';
12
12
 
13
13
  /**
14
14
  * @fileoverview added by tsickle
15
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
15
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
16
+ */
17
+ /**
18
+ * @license
19
+ * Copyright Google Inc. All Rights Reserved.
20
+ *
21
+ * Use of this source code is governed by an MIT-style license that can be
22
+ * found in the LICENSE file at https://angular.io/license
16
23
  */
17
24
  /**
18
25
  * \@description
@@ -60,10 +67,14 @@ class NavigationStart extends RouterEvent {
60
67
  * @param {?=} navigationTrigger
61
68
  * @param {?=} restoredState
62
69
  */
63
- constructor(/** @docsNotRequired */
64
- id, /** @docsNotRequired */
65
- url, /** @docsNotRequired */
66
- navigationTrigger = 'imperative', /** @docsNotRequired */
70
+ constructor(
71
+ /** @docsNotRequired */
72
+ id,
73
+ /** @docsNotRequired */
74
+ url,
75
+ /** @docsNotRequired */
76
+ navigationTrigger = 'imperative',
77
+ /** @docsNotRequired */
67
78
  restoredState = null) {
68
79
  super(id, url);
69
80
  this.navigationTrigger = navigationTrigger;
@@ -88,8 +99,10 @@ class NavigationEnd extends RouterEvent {
88
99
  * @param {?} url
89
100
  * @param {?} urlAfterRedirects
90
101
  */
91
- constructor(/** @docsNotRequired */
92
- id, /** @docsNotRequired */
102
+ constructor(
103
+ /** @docsNotRequired */
104
+ id,
105
+ /** @docsNotRequired */
93
106
  url, urlAfterRedirects) {
94
107
  super(id, url);
95
108
  this.urlAfterRedirects = urlAfterRedirects;
@@ -115,8 +128,10 @@ class NavigationCancel extends RouterEvent {
115
128
  * @param {?} url
116
129
  * @param {?} reason
117
130
  */
118
- constructor(/** @docsNotRequired */
119
- id, /** @docsNotRequired */
131
+ constructor(
132
+ /** @docsNotRequired */
133
+ id,
134
+ /** @docsNotRequired */
120
135
  url, reason) {
121
136
  super(id, url);
122
137
  this.reason = reason;
@@ -140,8 +155,10 @@ class NavigationError extends RouterEvent {
140
155
  * @param {?} url
141
156
  * @param {?} error
142
157
  */
143
- constructor(/** @docsNotRequired */
144
- id, /** @docsNotRequired */
158
+ constructor(
159
+ /** @docsNotRequired */
160
+ id,
161
+ /** @docsNotRequired */
145
162
  url, error) {
146
163
  super(id, url);
147
164
  this.error = error;
@@ -168,8 +185,10 @@ class RoutesRecognized extends RouterEvent {
168
185
  * @param {?} urlAfterRedirects
169
186
  * @param {?} state
170
187
  */
171
- constructor(/** @docsNotRequired */
172
- id, /** @docsNotRequired */
188
+ constructor(
189
+ /** @docsNotRequired */
190
+ id,
191
+ /** @docsNotRequired */
173
192
  url, urlAfterRedirects, state) {
174
193
  super(id, url);
175
194
  this.urlAfterRedirects = urlAfterRedirects;
@@ -197,8 +216,10 @@ class GuardsCheckStart extends RouterEvent {
197
216
  * @param {?} urlAfterRedirects
198
217
  * @param {?} state
199
218
  */
200
- constructor(/** @docsNotRequired */
201
- id, /** @docsNotRequired */
219
+ constructor(
220
+ /** @docsNotRequired */
221
+ id,
222
+ /** @docsNotRequired */
202
223
  url, urlAfterRedirects, state) {
203
224
  super(id, url);
204
225
  this.urlAfterRedirects = urlAfterRedirects;
@@ -226,8 +247,10 @@ class GuardsCheckEnd extends RouterEvent {
226
247
  * @param {?} state
227
248
  * @param {?} shouldActivate
228
249
  */
229
- constructor(/** @docsNotRequired */
230
- id, /** @docsNotRequired */
250
+ constructor(
251
+ /** @docsNotRequired */
252
+ id,
253
+ /** @docsNotRequired */
231
254
  url, urlAfterRedirects, state, shouldActivate) {
232
255
  super(id, url);
233
256
  this.urlAfterRedirects = urlAfterRedirects;
@@ -258,8 +281,10 @@ class ResolveStart extends RouterEvent {
258
281
  * @param {?} urlAfterRedirects
259
282
  * @param {?} state
260
283
  */
261
- constructor(/** @docsNotRequired */
262
- id, /** @docsNotRequired */
284
+ constructor(
285
+ /** @docsNotRequired */
286
+ id,
287
+ /** @docsNotRequired */
263
288
  url, urlAfterRedirects, state) {
264
289
  super(id, url);
265
290
  this.urlAfterRedirects = urlAfterRedirects;
@@ -287,8 +312,10 @@ class ResolveEnd extends RouterEvent {
287
312
  * @param {?} urlAfterRedirects
288
313
  * @param {?} state
289
314
  */
290
- constructor(/** @docsNotRequired */
291
- id, /** @docsNotRequired */
315
+ constructor(
316
+ /** @docsNotRequired */
317
+ id,
318
+ /** @docsNotRequired */
292
319
  url, urlAfterRedirects, state) {
293
320
  super(id, url);
294
321
  this.urlAfterRedirects = urlAfterRedirects;
@@ -448,10 +475,7 @@ class Scroll {
448
475
  * @param {?} position
449
476
  * @param {?} anchor
450
477
  */
451
- constructor(/** @docsNotRequired */
452
- routerEvent, /** @docsNotRequired */
453
- position, /** @docsNotRequired */
454
- anchor) {
478
+ constructor(routerEvent, position, anchor) {
455
479
  this.routerEvent = routerEvent;
456
480
  this.position = position;
457
481
  this.anchor = anchor;
@@ -468,7 +492,7 @@ class Scroll {
468
492
 
469
493
  /**
470
494
  * @fileoverview added by tsickle
471
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
495
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
472
496
  */
473
497
  /**
474
498
  * This component is used internally within the router to be a placeholder when an empty
@@ -487,7 +511,7 @@ EmptyOutletComponent.decorators = [
487
511
 
488
512
  /**
489
513
  * @fileoverview added by tsickle
490
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
514
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
491
515
  */
492
516
  /**
493
517
  * @license
@@ -496,13 +520,14 @@ EmptyOutletComponent.decorators = [
496
520
  * Use of this source code is governed by an MIT-style license that can be
497
521
  * found in the LICENSE file at https://angular.io/license
498
522
  */
499
- /** *
523
+ /**
500
524
  * \@description
501
525
  *
502
526
  * Name of the primary outlet.
503
527
  *
504
528
  * \@publicApi
505
- @type {?} */
529
+ * @type {?}
530
+ */
506
531
  const PRIMARY_OUTLET = 'primary';
507
532
  class ParamsAsMap {
508
533
  /**
@@ -562,7 +587,7 @@ const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
562
587
  function navigationCancelingError(message) {
563
588
  /** @type {?} */
564
589
  const error = Error('NavigationCancelingError: ' + message);
565
- (/** @type {?} */ (error))[NAVIGATION_CANCELING_ERROR] = true;
590
+ ((/** @type {?} */ (error)))[NAVIGATION_CANCELING_ERROR] = true;
566
591
  return error;
567
592
  }
568
593
  /**
@@ -570,8 +595,9 @@ function navigationCancelingError(message) {
570
595
  * @return {?}
571
596
  */
572
597
  function isNavigationCancelingError(error) {
573
- return error && (/** @type {?} */ (error))[NAVIGATION_CANCELING_ERROR];
598
+ return error && ((/** @type {?} */ (error)))[NAVIGATION_CANCELING_ERROR];
574
599
  }
600
+ // Matches the route configuration (`route`) against the actual URL (`segments`).
575
601
  /**
576
602
  * @param {?} segments
577
603
  * @param {?} segmentGroup
@@ -580,7 +606,7 @@ function isNavigationCancelingError(error) {
580
606
  */
581
607
  function defaultUrlMatcher(segments, segmentGroup, route) {
582
608
  /** @type {?} */
583
- const parts = /** @type {?} */ ((route.path)).split('/');
609
+ const parts = (/** @type {?} */ (route.path)).split('/');
584
610
  if (parts.length > segments.length) {
585
611
  // The actual URL is shorter than the config, no match
586
612
  return null;
@@ -613,7 +639,7 @@ function defaultUrlMatcher(segments, segmentGroup, route) {
613
639
 
614
640
  /**
615
641
  * @fileoverview added by tsickle
616
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
642
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
617
643
  */
618
644
  class LoadedRouterConfig {
619
645
  /**
@@ -742,7 +768,7 @@ function standardizeConfig(r) {
742
768
 
743
769
  /**
744
770
  * @fileoverview added by tsickle
745
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
771
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
746
772
  */
747
773
  /**
748
774
  * @param {?} a
@@ -861,7 +887,7 @@ function wrapIntoObservable(value) {
861
887
 
862
888
  /**
863
889
  * @fileoverview added by tsickle
864
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
890
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
865
891
  */
866
892
  /**
867
893
  * @return {?}
@@ -1207,7 +1233,7 @@ class DefaultUrlSerializer {
1207
1233
  /** @type {?} */
1208
1234
  const query = serializeQueryParams(tree.queryParams);
1209
1235
  /** @type {?} */
1210
- const fragment = typeof tree.fragment === `string` ? `#${encodeUriFragment((/** @type {?} */ ((tree.fragment))))}` : '';
1236
+ const fragment = typeof tree.fragment === `string` ? `#${encodeUriFragment((/** @type {?} */ (tree.fragment)))}` : '';
1211
1237
  return `${segment}${query}${fragment}`;
1212
1238
  }
1213
1239
  }
@@ -1310,6 +1336,8 @@ function encodeUriSegment(s) {
1310
1336
  function decode(s) {
1311
1337
  return decodeURIComponent(s);
1312
1338
  }
1339
+ // Query keys/values should have the "+" replaced first, as "+" in a query string is " ".
1340
+ // decodeURIComponent function will not decode "+" as a space.
1313
1341
  /**
1314
1342
  * @param {?} s
1315
1343
  * @return {?}
@@ -1361,6 +1389,7 @@ function matchSegments(str) {
1361
1389
  }
1362
1390
  /** @type {?} */
1363
1391
  const QUERY_PARAM_RE = /^[^=?&#]+/;
1392
+ // Return the name of the query param at the start of the string or an empty string
1364
1393
  /**
1365
1394
  * @param {?} str
1366
1395
  * @return {?}
@@ -1372,6 +1401,7 @@ function matchQueryParams(str) {
1372
1401
  }
1373
1402
  /** @type {?} */
1374
1403
  const QUERY_PARAM_VALUE_RE = /^[^?&#]+/;
1404
+ // Return the value of the query param at the start of the string or an empty string
1375
1405
  /**
1376
1406
  * @param {?} str
1377
1407
  * @return {?}
@@ -1452,6 +1482,8 @@ class UrlParser {
1452
1482
  }
1453
1483
  return res;
1454
1484
  }
1485
+ // parse a segment with its matrix parameters
1486
+ // ie `name;k1=v1;k2`
1455
1487
  /**
1456
1488
  * @return {?}
1457
1489
  */
@@ -1498,6 +1530,7 @@ class UrlParser {
1498
1530
  }
1499
1531
  params[decode(key)] = decode(value);
1500
1532
  }
1533
+ // Parse a single query parameter `name[=value]`
1501
1534
  /**
1502
1535
  * @param {?} params
1503
1536
  * @return {?}
@@ -1524,6 +1557,7 @@ class UrlParser {
1524
1557
  /** @type {?} */
1525
1558
  const decodedVal = decodeQuery(value);
1526
1559
  if (params.hasOwnProperty(decodedKey)) {
1560
+ // Append to existing values
1527
1561
  /** @type {?} */
1528
1562
  let currentVal = params[decodedKey];
1529
1563
  if (!Array.isArray(currentVal)) {
@@ -1537,6 +1571,7 @@ class UrlParser {
1537
1571
  params[decodedKey] = decodedVal;
1538
1572
  }
1539
1573
  }
1574
+ // parse `(a/b//outlet_name:c/d)`
1540
1575
  /**
1541
1576
  * @param {?} allowPrimary
1542
1577
  * @return {?}
@@ -1556,7 +1591,7 @@ class UrlParser {
1556
1591
  throw new Error(`Cannot parse url '${this.url}'`);
1557
1592
  }
1558
1593
  /** @type {?} */
1559
- let outletName = /** @type {?} */ ((undefined));
1594
+ let outletName = (/** @type {?} */ (undefined));
1560
1595
  if (path.indexOf(':') > -1) {
1561
1596
  outletName = path.substr(0, path.indexOf(':'));
1562
1597
  this.capture(outletName);
@@ -1578,6 +1613,7 @@ class UrlParser {
1578
1613
  * @return {?}
1579
1614
  */
1580
1615
  peekStartsWith(str) { return this.remaining.startsWith(str); }
1616
+ // Consumes the prefix when it is present and returns whether it has been consumed
1581
1617
  /**
1582
1618
  * @param {?} str
1583
1619
  * @return {?}
@@ -1602,7 +1638,7 @@ class UrlParser {
1602
1638
 
1603
1639
  /**
1604
1640
  * @fileoverview added by tsickle
1605
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1641
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
1606
1642
  */
1607
1643
  /**
1608
1644
  * @license
@@ -1674,6 +1710,7 @@ class Tree {
1674
1710
  */
1675
1711
  pathFromRoot(t) { return findPath(t, this._root).map(s => s.value); }
1676
1712
  }
1713
+ // DFS for the node matching the value
1677
1714
  /**
1678
1715
  * @template T
1679
1716
  * @param {?} value
@@ -1691,6 +1728,7 @@ function findNode(value, node) {
1691
1728
  }
1692
1729
  return null;
1693
1730
  }
1731
+ // Return the path to the node with the given value using DFS
1694
1732
  /**
1695
1733
  * @template T
1696
1734
  * @param {?} value
@@ -1727,6 +1765,7 @@ class TreeNode {
1727
1765
  */
1728
1766
  toString() { return `TreeNode(${this.value})`; }
1729
1767
  }
1768
+ // Return the list of T indexed by outlet name
1730
1769
  /**
1731
1770
  * @template T
1732
1771
  * @param {?} node
@@ -1743,7 +1782,7 @@ function nodeChildrenAsMap(node) {
1743
1782
 
1744
1783
  /**
1745
1784
  * @fileoverview added by tsickle
1746
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1785
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
1747
1786
  */
1748
1787
  /**
1749
1788
  * \@description
@@ -1782,7 +1821,7 @@ class RouterState extends Tree {
1782
1821
  constructor(root, snapshot) {
1783
1822
  super(root);
1784
1823
  this.snapshot = snapshot;
1785
- setRouterState(/** @type {?} */ (this), root);
1824
+ setRouterState((/** @type {?} */ (this)), root);
1786
1825
  }
1787
1826
  /**
1788
1827
  * @return {?}
@@ -1977,7 +2016,7 @@ function flattenInherited(pathFromRoot) {
1977
2016
  /** @type {?} */
1978
2017
  const resolve = Object.assign({}, res.resolve, curr._resolvedData);
1979
2018
  return { params, data, resolve };
1980
- }, /** @type {?} */ ({ params: {}, data: {}, resolve: {} }));
2019
+ }, (/** @type {?} */ ({ params: {}, data: {}, resolve: {} })));
1981
2020
  }
1982
2021
  /**
1983
2022
  * \@description
@@ -2117,7 +2156,7 @@ class RouterStateSnapshot extends Tree {
2117
2156
  constructor(url, root) {
2118
2157
  super(root);
2119
2158
  this.url = url;
2120
- setRouterState(/** @type {?} */ (this), root);
2159
+ setRouterState((/** @type {?} */ (this)), root);
2121
2160
  }
2122
2161
  /**
2123
2162
  * @return {?}
@@ -2158,25 +2197,25 @@ function advanceActivatedRoute(route) {
2158
2197
  const nextSnapshot = route._futureSnapshot;
2159
2198
  route.snapshot = nextSnapshot;
2160
2199
  if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {
2161
- (/** @type {?} */ (route.queryParams)).next(nextSnapshot.queryParams);
2200
+ ((/** @type {?} */ (route.queryParams))).next(nextSnapshot.queryParams);
2162
2201
  }
2163
2202
  if (currentSnapshot.fragment !== nextSnapshot.fragment) {
2164
- (/** @type {?} */ (route.fragment)).next(nextSnapshot.fragment);
2203
+ ((/** @type {?} */ (route.fragment))).next(nextSnapshot.fragment);
2165
2204
  }
2166
2205
  if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {
2167
- (/** @type {?} */ (route.params)).next(nextSnapshot.params);
2206
+ ((/** @type {?} */ (route.params))).next(nextSnapshot.params);
2168
2207
  }
2169
2208
  if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {
2170
- (/** @type {?} */ (route.url)).next(nextSnapshot.url);
2209
+ ((/** @type {?} */ (route.url))).next(nextSnapshot.url);
2171
2210
  }
2172
2211
  if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {
2173
- (/** @type {?} */ (route.data)).next(nextSnapshot.data);
2212
+ ((/** @type {?} */ (route.data))).next(nextSnapshot.data);
2174
2213
  }
2175
2214
  }
2176
2215
  else {
2177
2216
  route.snapshot = route._futureSnapshot;
2178
2217
  // this is for resolved data
2179
- (/** @type {?} */ (route.data)).next(route._futureSnapshot.data);
2218
+ ((/** @type {?} */ (route.data))).next(route._futureSnapshot.data);
2180
2219
  }
2181
2220
  }
2182
2221
  /**
@@ -2190,12 +2229,12 @@ function equalParamsAndUrlSegments(a, b) {
2190
2229
  /** @type {?} */
2191
2230
  const parentsMismatch = !a.parent !== !b.parent;
2192
2231
  return equalUrlParams && !parentsMismatch &&
2193
- (!a.parent || equalParamsAndUrlSegments(a.parent, /** @type {?} */ ((b.parent))));
2232
+ (!a.parent || equalParamsAndUrlSegments(a.parent, (/** @type {?} */ (b.parent))));
2194
2233
  }
2195
2234
 
2196
2235
  /**
2197
2236
  * @fileoverview added by tsickle
2198
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2237
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
2199
2238
  */
2200
2239
  /**
2201
2240
  * @param {?} routeReuseStrategy
@@ -2227,7 +2266,7 @@ function createNode(routeReuseStrategy, curr, prevState) {
2227
2266
  }
2228
2267
  else {
2229
2268
  /** @type {?} */
2230
- const detachedRouteHandle = /** @type {?} */ (routeReuseStrategy.retrieve(curr.value));
2269
+ const detachedRouteHandle = (/** @type {?} */ (routeReuseStrategy.retrieve(curr.value)));
2231
2270
  if (detachedRouteHandle) {
2232
2271
  /** @type {?} */
2233
2272
  const tree = detachedRouteHandle.route;
@@ -2286,7 +2325,7 @@ function createActivatedRoute(c) {
2286
2325
 
2287
2326
  /**
2288
2327
  * @fileoverview added by tsickle
2289
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2328
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
2290
2329
  */
2291
2330
  /**
2292
2331
  * @param {?} route
@@ -2421,11 +2460,9 @@ function computeNavigation(commands) {
2421
2460
  cmd.split('/').forEach((urlPart, partIndex) => {
2422
2461
  if (partIndex == 0 && urlPart === '.') ;
2423
2462
  else if (partIndex == 0 && urlPart === '') { // '/a'
2424
- // '/a'
2425
2463
  isAbsolute = true;
2426
2464
  }
2427
2465
  else if (urlPart === '..') { // '../a'
2428
- // '../a'
2429
2466
  numberOfDoubleDots++;
2430
2467
  }
2431
2468
  else if (urlPart != '') {
@@ -2484,7 +2521,7 @@ function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
2484
2521
  let dd = numberOfDoubleDots;
2485
2522
  while (dd > ci) {
2486
2523
  dd -= ci;
2487
- g = /** @type {?} */ ((g.parent));
2524
+ g = (/** @type {?} */ (g.parent));
2488
2525
  if (!g) {
2489
2526
  throw new Error('Invalid number of \'../\'');
2490
2527
  }
@@ -2692,11 +2729,11 @@ function compare(path, params, segment) {
2692
2729
 
2693
2730
  /**
2694
2731
  * @fileoverview added by tsickle
2695
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2732
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
2696
2733
  */
2697
2734
  /** @type {?} */
2698
2735
  const activateRoutes = (rootContexts, routeReuseStrategy, forwardEvent) => map(t => {
2699
- new ActivateRoutes(routeReuseStrategy, /** @type {?} */ ((t.targetRouterState)), t.currentRouterState, forwardEvent)
2736
+ new ActivateRoutes(routeReuseStrategy, (/** @type {?} */ (t.targetRouterState)), t.currentRouterState, forwardEvent)
2700
2737
  .activate(rootContexts);
2701
2738
  return t;
2702
2739
  });
@@ -2726,6 +2763,7 @@ class ActivateRoutes {
2726
2763
  advanceActivatedRoute(this.futureState.root);
2727
2764
  this.activateChildRoutes(futureRoot, currRoot, parentContexts);
2728
2765
  }
2766
+ // De-activate the child route that are not re-used for the future state
2729
2767
  /**
2730
2768
  * @param {?} futureNode
2731
2769
  * @param {?} currNode
@@ -2761,6 +2799,7 @@ class ActivateRoutes {
2761
2799
  if (future === curr) {
2762
2800
  // Reusing the node, check to see if the children need to be de-activated
2763
2801
  if (future.component) {
2802
+ // If we have a normal route, we need to go through an outlet.
2764
2803
  /** @type {?} */
2765
2804
  const context = parentContext.getContext(future.outlet);
2766
2805
  if (context) {
@@ -2862,6 +2901,7 @@ class ActivateRoutes {
2862
2901
  // reusing the node
2863
2902
  if (future === curr) {
2864
2903
  if (future.component) {
2904
+ // If we have a normal route, we need to go through an outlet.
2865
2905
  /** @type {?} */
2866
2906
  const context = parentContexts.getOrCreateContext(future.outlet);
2867
2907
  this.activateChildRoutes(futureNode, currNode, context.children);
@@ -2873,11 +2913,12 @@ class ActivateRoutes {
2873
2913
  }
2874
2914
  else {
2875
2915
  if (future.component) {
2916
+ // if we have a normal route, we need to place the component into the outlet and recurse.
2876
2917
  /** @type {?} */
2877
2918
  const context = parentContexts.getOrCreateContext(future.outlet);
2878
2919
  if (this.routeReuseStrategy.shouldAttach(future.snapshot)) {
2879
2920
  /** @type {?} */
2880
- const stored = (/** @type {?} */ (this.routeReuseStrategy.retrieve(future.snapshot)));
2921
+ const stored = ((/** @type {?} */ (this.routeReuseStrategy.retrieve(future.snapshot))));
2881
2922
  this.routeReuseStrategy.store(future.snapshot, null);
2882
2923
  context.children.onOutletReAttached(stored.contexts);
2883
2924
  context.attachRef = stored.componentRef;
@@ -2938,7 +2979,7 @@ function parentLoadedConfig(snapshot) {
2938
2979
 
2939
2980
  /**
2940
2981
  * @fileoverview added by tsickle
2941
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
2982
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
2942
2983
  */
2943
2984
  /**
2944
2985
  * Simple function check, but generic so type inference will flow. Example:
@@ -3005,7 +3046,7 @@ function isCanDeactivate(guard) {
3005
3046
 
3006
3047
  /**
3007
3048
  * @fileoverview added by tsickle
3008
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3049
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
3009
3050
  */
3010
3051
  class NoMatch {
3011
3052
  /**
@@ -3086,7 +3127,7 @@ class ApplyRedirects {
3086
3127
  /** @type {?} */
3087
3128
  const expanded$ = this.expandSegmentGroup(this.ngModule, this.config, this.urlTree.root, PRIMARY_OUTLET);
3088
3129
  /** @type {?} */
3089
- const urlTrees$ = expanded$.pipe(map((rootSegmentGroup) => this.createUrlTree(rootSegmentGroup, this.urlTree.queryParams, /** @type {?} */ ((this.urlTree.fragment)))));
3130
+ const urlTrees$ = expanded$.pipe(map((rootSegmentGroup) => this.createUrlTree(rootSegmentGroup, this.urlTree.queryParams, (/** @type {?} */ (this.urlTree.fragment)))));
3090
3131
  return urlTrees$.pipe(catchError((e) => {
3091
3132
  if (e instanceof AbsoluteRedirect) {
3092
3133
  // after an absolute redirect we do not apply any more redirects!
@@ -3108,7 +3149,7 @@ class ApplyRedirects {
3108
3149
  /** @type {?} */
3109
3150
  const expanded$ = this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);
3110
3151
  /** @type {?} */
3111
- const mapped$ = expanded$.pipe(map((rootSegmentGroup) => this.createUrlTree(rootSegmentGroup, tree.queryParams, /** @type {?} */ ((tree.fragment)))));
3152
+ const mapped$ = expanded$.pipe(map((rootSegmentGroup) => this.createUrlTree(rootSegmentGroup, tree.queryParams, (/** @type {?} */ (tree.fragment)))));
3112
3153
  return mapped$.pipe(catchError((e) => {
3113
3154
  if (e instanceof NoMatch) {
3114
3155
  throw this.noMatchError(e);
@@ -3150,6 +3191,7 @@ class ApplyRedirects {
3150
3191
  }
3151
3192
  return this.expandSegment(ngModule, segmentGroup, routes, segmentGroup.segments, outlet, true);
3152
3193
  }
3194
+ // Recursively expand segment groups for all the child outlets
3153
3195
  /**
3154
3196
  * @param {?} ngModule
3155
3197
  * @param {?} routes
@@ -3176,7 +3218,7 @@ class ApplyRedirects {
3176
3218
  if (e instanceof NoMatch) {
3177
3219
  // TODO(i): this return type doesn't match the declared Observable<UrlSegmentGroup> -
3178
3220
  // talk to Jason
3179
- return /** @type {?} */ (of(null));
3221
+ return (/** @type {?} */ (of(null)));
3180
3222
  }
3181
3223
  throw e;
3182
3224
  }));
@@ -3245,8 +3287,8 @@ class ApplyRedirects {
3245
3287
  */
3246
3288
  expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet) {
3247
3289
  /** @type {?} */
3248
- const newTree = this.applyRedirectCommands([], /** @type {?} */ ((route.redirectTo)), {});
3249
- if (/** @type {?} */ ((route.redirectTo)).startsWith('/')) {
3290
+ const newTree = this.applyRedirectCommands([], (/** @type {?} */ (route.redirectTo)), {});
3291
+ if ((/** @type {?} */ (route.redirectTo)).startsWith('/')) {
3250
3292
  return absoluteRedirect(newTree);
3251
3293
  }
3252
3294
  return this.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments) => {
@@ -3269,8 +3311,8 @@ class ApplyRedirects {
3269
3311
  if (!matched)
3270
3312
  return noMatch(segmentGroup);
3271
3313
  /** @type {?} */
3272
- const newTree = this.applyRedirectCommands(consumedSegments, /** @type {?} */ ((route.redirectTo)), /** @type {?} */ (positionalParamSegments));
3273
- if (/** @type {?} */ ((route.redirectTo)).startsWith('/')) {
3314
+ const newTree = this.applyRedirectCommands(consumedSegments, (/** @type {?} */ (route.redirectTo)), (/** @type {?} */ (positionalParamSegments)));
3315
+ if ((/** @type {?} */ (route.redirectTo)).startsWith('/')) {
3274
3316
  return absoluteRedirect(newTree);
3275
3317
  }
3276
3318
  return this.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments) => {
@@ -3367,7 +3409,7 @@ class ApplyRedirects {
3367
3409
  return of(res);
3368
3410
  }
3369
3411
  if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {
3370
- return namedOutletsRedirect(/** @type {?} */ ((route.redirectTo)));
3412
+ return namedOutletsRedirect((/** @type {?} */ (route.redirectTo)));
3371
3413
  }
3372
3414
  c = c.children[PRIMARY_OUTLET];
3373
3415
  }
@@ -3524,16 +3566,16 @@ function match(segmentGroup, route, segments) {
3524
3566
  if (!res) {
3525
3567
  return {
3526
3568
  matched: false,
3527
- consumedSegments: /** @type {?} */ ([]),
3569
+ consumedSegments: (/** @type {?} */ ([])),
3528
3570
  lastChild: 0,
3529
3571
  positionalParamSegments: {},
3530
3572
  };
3531
3573
  }
3532
3574
  return {
3533
3575
  matched: true,
3534
- consumedSegments: /** @type {?} */ ((res.consumed)),
3535
- lastChild: /** @type {?} */ ((res.consumed.length)),
3536
- positionalParamSegments: /** @type {?} */ ((res.posParams)),
3576
+ consumedSegments: (/** @type {?} */ (res.consumed)),
3577
+ lastChild: (/** @type {?} */ (res.consumed.length)),
3578
+ positionalParamSegments: (/** @type {?} */ (res.posParams)),
3537
3579
  };
3538
3580
  }
3539
3581
  /**
@@ -3643,7 +3685,7 @@ function getOutlet(route) {
3643
3685
 
3644
3686
  /**
3645
3687
  * @fileoverview added by tsickle
3646
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3688
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
3647
3689
  */
3648
3690
  /**
3649
3691
  * @param {?} moduleInjector
@@ -3661,7 +3703,7 @@ function applyRedirects$1(moduleInjector, configLoader, urlSerializer, config) {
3661
3703
 
3662
3704
  /**
3663
3705
  * @fileoverview added by tsickle
3664
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3706
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
3665
3707
  */
3666
3708
  class CanActivate {
3667
3709
  /**
@@ -3754,7 +3796,7 @@ function getChildRouteGuards(futureNode, currNode, contexts, futurePath, checks
3754
3796
  delete prevChildren[c.value.outlet];
3755
3797
  });
3756
3798
  // Process any children left from the current route (not active for the future route)
3757
- forEach(prevChildren, (v, k) => deactivateRouteAndItsChildren(v, /** @type {?} */ ((contexts)).getContext(k), checks));
3799
+ forEach(prevChildren, (v, k) => deactivateRouteAndItsChildren(v, (/** @type {?} */ (contexts)).getContext(k), checks));
3758
3800
  return checks;
3759
3801
  }
3760
3802
  /**
@@ -3778,7 +3820,7 @@ function getRouteGuards(futureNode, currNode, parentContexts, futurePath, checks
3778
3820
  // reusing the node
3779
3821
  if (curr && future.routeConfig === curr.routeConfig) {
3780
3822
  /** @type {?} */
3781
- const shouldRun = shouldRunGuardsAndResolvers(curr, future, /** @type {?} */ ((future.routeConfig)).runGuardsAndResolvers);
3823
+ const shouldRun = shouldRunGuardsAndResolvers(curr, future, (/** @type {?} */ (future.routeConfig)).runGuardsAndResolvers);
3782
3824
  if (shouldRun) {
3783
3825
  checks.canActivateChecks.push(new CanActivate(futurePath));
3784
3826
  }
@@ -3872,7 +3914,7 @@ function deactivateRouteAndItsChildren(route, context, checks) {
3872
3914
 
3873
3915
  /**
3874
3916
  * @fileoverview added by tsickle
3875
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3917
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
3876
3918
  */
3877
3919
  /** @type {?} */
3878
3920
  const INITIAL_VALUE = Symbol('INITIAL_VALUE');
@@ -3881,7 +3923,7 @@ const INITIAL_VALUE = Symbol('INITIAL_VALUE');
3881
3923
  */
3882
3924
  function prioritizedGuardValue() {
3883
3925
  return switchMap(obs => {
3884
- return /** @type {?} */ (combineLatest(...obs.map(o => o.pipe(take(1), startWith(/** @type {?} */ (INITIAL_VALUE)))))
3926
+ return (/** @type {?} */ (combineLatest(...obs.map(o => o.pipe(take(1), startWith((/** @type {?} */ (INITIAL_VALUE))))))
3885
3927
  .pipe(scan((acc, list) => {
3886
3928
  /** @type {?} */
3887
3929
  let isPending = false;
@@ -3907,14 +3949,13 @@ function prioritizedGuardValue() {
3907
3949
  return innerAcc;
3908
3950
  }, acc);
3909
3951
  }, INITIAL_VALUE), filter(item => item !== INITIAL_VALUE), map(item => isUrlTree(item) ? item : item === true), //
3910
- //
3911
- take(1)));
3952
+ take(1))));
3912
3953
  });
3913
3954
  }
3914
3955
 
3915
3956
  /**
3916
3957
  * @fileoverview added by tsickle
3917
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
3958
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
3918
3959
  */
3919
3960
  /**
3920
3961
  * @param {?} moduleInjector
@@ -3928,10 +3969,10 @@ function checkGuards(moduleInjector, forwardEvent) {
3928
3969
  if (canDeactivateChecks.length === 0 && canActivateChecks.length === 0) {
3929
3970
  return of(Object.assign({}, t, { guardsResult: true }));
3930
3971
  }
3931
- return runCanDeactivateChecks(canDeactivateChecks, /** @type {?} */ ((targetSnapshot)), currentSnapshot, moduleInjector)
3972
+ return runCanDeactivateChecks(canDeactivateChecks, (/** @type {?} */ (targetSnapshot)), currentSnapshot, moduleInjector)
3932
3973
  .pipe(mergeMap(canDeactivate => {
3933
3974
  return canDeactivate && isBoolean(canDeactivate) ?
3934
- runCanActivateChecks(/** @type {?} */ ((targetSnapshot)), canActivateChecks, moduleInjector, forwardEvent) :
3975
+ runCanActivateChecks((/** @type {?} */ (targetSnapshot)), canActivateChecks, moduleInjector, forwardEvent) :
3935
3976
  of(canDeactivate);
3936
3977
  }), map(guardsResult => (Object.assign({}, t, { guardsResult }))));
3937
3978
  }));
@@ -3945,7 +3986,7 @@ function checkGuards(moduleInjector, forwardEvent) {
3945
3986
  * @return {?}
3946
3987
  */
3947
3988
  function runCanDeactivateChecks(checks, futureRSS, currRSS, moduleInjector) {
3948
- return from(checks).pipe(mergeMap(check => runCanDeactivate(check.component, check.route, currRSS, futureRSS, moduleInjector)), first(result => { return result !== true; }, /** @type {?} */ (true)));
3989
+ return from(checks).pipe(mergeMap(check => runCanDeactivate(check.component, check.route, currRSS, futureRSS, moduleInjector)), first(result => { return result !== true; }, (/** @type {?} */ (true))));
3949
3990
  }
3950
3991
  /**
3951
3992
  * @param {?} futureSnapshot
@@ -3964,8 +4005,8 @@ function runCanActivateChecks(futureSnapshot, checks, moduleInjector, forwardEve
3964
4005
  ])
3965
4006
  .pipe(concatAll(), first(result => {
3966
4007
  return result !== true;
3967
- }, /** @type {?} */ (true)));
3968
- }), first(result => { return result !== true; }, /** @type {?} */ (true)));
4008
+ }, (/** @type {?} */ (true))));
4009
+ }), first(result => { return result !== true; }, (/** @type {?} */ (true))));
3969
4010
  }
3970
4011
  /**
3971
4012
  * This should fire off `ActivationStart` events for each route being activated at this
@@ -4093,7 +4134,7 @@ function runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector
4093
4134
  let observable;
4094
4135
  if (isCanDeactivate(guard)) {
4095
4136
  observable =
4096
- wrapIntoObservable(guard.canDeactivate(/** @type {?} */ ((component)), currARS, currRSS, futureRSS));
4137
+ wrapIntoObservable(guard.canDeactivate((/** @type {?} */ (component)), currARS, currRSS, futureRSS));
4097
4138
  }
4098
4139
  else if (isFunction(guard)) {
4099
4140
  observable = wrapIntoObservable(guard(component, currARS, currRSS, futureRSS));
@@ -4108,7 +4149,7 @@ function runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector
4108
4149
 
4109
4150
  /**
4110
4151
  * @fileoverview added by tsickle
4111
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4152
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4112
4153
  */
4113
4154
  class NoMatch$1 {
4114
4155
  }
@@ -4152,7 +4193,7 @@ class Recognizer {
4152
4193
  /** @type {?} */
4153
4194
  const children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);
4154
4195
  /** @type {?} */
4155
- const root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze(Object.assign({}, this.urlTree.queryParams)), /** @type {?} */ ((this.urlTree.fragment)), {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});
4196
+ const root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze(Object.assign({}, this.urlTree.queryParams)), (/** @type {?} */ (this.urlTree.fragment)), {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});
4156
4197
  /** @type {?} */
4157
4198
  const rootNode = new TreeNode(root, children);
4158
4199
  /** @type {?} */
@@ -4252,15 +4293,15 @@ class Recognizer {
4252
4293
  let rawSlicedSegments = [];
4253
4294
  if (route.path === '**') {
4254
4295
  /** @type {?} */
4255
- const params = segments.length > 0 ? /** @type {?} */ ((last$1(segments))).parameters : {};
4256
- snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object.assign({}, this.urlTree.queryParams)), /** @type {?} */ ((this.urlTree.fragment)), getData(route), outlet, /** @type {?} */ ((route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));
4296
+ const params = segments.length > 0 ? (/** @type {?} */ (last$1(segments))).parameters : {};
4297
+ snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object.assign({}, this.urlTree.queryParams)), (/** @type {?} */ (this.urlTree.fragment)), getData(route), outlet, (/** @type {?} */ (route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));
4257
4298
  }
4258
4299
  else {
4259
4300
  /** @type {?} */
4260
4301
  const result = match$1(rawSegment, route, segments);
4261
4302
  consumedSegments = result.consumedSegments;
4262
4303
  rawSlicedSegments = segments.slice(result.lastChild);
4263
- snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), /** @type {?} */ ((this.urlTree.fragment)), getData(route), outlet, /** @type {?} */ ((route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
4304
+ snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), (/** @type {?} */ (this.urlTree.fragment)), getData(route), outlet, (/** @type {?} */ (route.component)), route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
4264
4305
  }
4265
4306
  /** @type {?} */
4266
4307
  const childConfig = getChildConfig(route);
@@ -4300,7 +4341,7 @@ function getChildConfig(route) {
4300
4341
  return route.children;
4301
4342
  }
4302
4343
  if (route.loadChildren) {
4303
- return /** @type {?} */ ((route._loadedConfig)).routes;
4344
+ return (/** @type {?} */ (route._loadedConfig)).routes;
4304
4345
  }
4305
4346
  return [];
4306
4347
  }
@@ -4325,7 +4366,7 @@ function match$1(segmentGroup, route, segments) {
4325
4366
  throw new NoMatch$1();
4326
4367
  /** @type {?} */
4327
4368
  const posParams = {};
4328
- forEach(/** @type {?} */ ((res.posParams)), (v, k) => { posParams[k] = v.path; });
4369
+ forEach((/** @type {?} */ (res.posParams)), (v, k) => { posParams[k] = v.path; });
4329
4370
  /** @type {?} */
4330
4371
  const parameters = res.consumed.length > 0 ? Object.assign({}, posParams, res.consumed[res.consumed.length - 1].parameters) :
4331
4372
  posParams;
@@ -4515,7 +4556,7 @@ function getResolve(route) {
4515
4556
 
4516
4557
  /**
4517
4558
  * @fileoverview added by tsickle
4518
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4559
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4519
4560
  */
4520
4561
  /**
4521
4562
  * @param {?} rootComponentType
@@ -4534,7 +4575,7 @@ function recognize$1(rootComponentType, config, serializer, paramsInheritanceStr
4534
4575
 
4535
4576
  /**
4536
4577
  * @fileoverview added by tsickle
4537
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4578
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4538
4579
  */
4539
4580
  /**
4540
4581
  * @param {?} paramsInheritanceStrategy
@@ -4549,7 +4590,7 @@ function resolveData(paramsInheritanceStrategy, moduleInjector) {
4549
4590
  return of(t);
4550
4591
  }
4551
4592
  return from(canActivateChecks)
4552
- .pipe(concatMap(check => runResolve(check.route, /** @type {?} */ ((targetSnapshot)), paramsInheritanceStrategy, moduleInjector)), reduce((_, __) => _), map(_ => t));
4593
+ .pipe(concatMap(check => runResolve(check.route, (/** @type {?} */ (targetSnapshot)), paramsInheritanceStrategy, moduleInjector)), reduce((_, __) => _), map(_ => t));
4553
4594
  }));
4554
4595
  };
4555
4596
  }
@@ -4617,7 +4658,7 @@ function getResolver(injectionToken, futureARS, futureRSS, moduleInjector) {
4617
4658
 
4618
4659
  /**
4619
4660
  * @fileoverview added by tsickle
4620
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4661
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4621
4662
  */
4622
4663
  /**
4623
4664
  * Perform a side effect through a switchMap for every emission on the source Observable,
@@ -4643,7 +4684,14 @@ function switchTap(next) {
4643
4684
 
4644
4685
  /**
4645
4686
  * @fileoverview added by tsickle
4646
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4687
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4688
+ */
4689
+ /**
4690
+ * @license
4691
+ * Copyright Google Inc. All Rights Reserved.
4692
+ *
4693
+ * Use of this source code is governed by an MIT-style license that can be
4694
+ * found in the LICENSE file at https://angular.io/license
4647
4695
  */
4648
4696
  /**
4649
4697
  * \@description
@@ -4692,12 +4740,13 @@ class DefaultRouteReuseStrategy {
4692
4740
 
4693
4741
  /**
4694
4742
  * @fileoverview added by tsickle
4695
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4743
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4696
4744
  */
4697
- /** *
4745
+ /**
4698
4746
  * \@docsNotRequired
4699
4747
  * \@publicApi
4700
- @type {?} */
4748
+ * @type {?}
4749
+ */
4701
4750
  const ROUTES = new InjectionToken('ROUTES');
4702
4751
  class RouterConfigLoader {
4703
4752
  /**
@@ -4722,7 +4771,7 @@ class RouterConfigLoader {
4722
4771
  this.onLoadStartListener(route);
4723
4772
  }
4724
4773
  /** @type {?} */
4725
- const moduleFactory$ = this.loadModuleFactory(/** @type {?} */ ((route.loadChildren)));
4774
+ const moduleFactory$ = this.loadModuleFactory((/** @type {?} */ (route.loadChildren)));
4726
4775
  return moduleFactory$.pipe(map((factory) => {
4727
4776
  if (this.onLoadEndListener) {
4728
4777
  this.onLoadEndListener(route);
@@ -4755,7 +4804,7 @@ class RouterConfigLoader {
4755
4804
 
4756
4805
  /**
4757
4806
  * @fileoverview added by tsickle
4758
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4807
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4759
4808
  */
4760
4809
  /**
4761
4810
  * @license
@@ -4798,7 +4847,7 @@ class DefaultUrlHandlingStrategy {
4798
4847
 
4799
4848
  /**
4800
4849
  * @fileoverview added by tsickle
4801
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
4850
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
4802
4851
  */
4803
4852
  /**
4804
4853
  * @param {?} error
@@ -4823,7 +4872,7 @@ function defaultMalformedUriErrorHandler(error, urlSerializer, url) {
4823
4872
  * @return {?}
4824
4873
  */
4825
4874
  function defaultRouterHook(snapshot, runExtras) {
4826
- return /** @type {?} */ (of(null));
4875
+ return (/** @type {?} */ (of(null)));
4827
4876
  }
4828
4877
  /**
4829
4878
  * \@description
@@ -4848,6 +4897,7 @@ class Router {
4848
4897
  * @param {?} compiler
4849
4898
  * @param {?} config
4850
4899
  */
4900
+ // TODO: vsavkin make internal after the final is out.
4851
4901
  constructor(rootComponentType, urlSerializer, rootContexts, location, injector, loader, compiler, config) {
4852
4902
  this.rootComponentType = rootComponentType;
4853
4903
  this.urlSerializer = urlSerializer;
@@ -4962,10 +5012,10 @@ class Router {
4962
5012
  */
4963
5013
  setupNavigations(transitions) {
4964
5014
  /** @type {?} */
4965
- const eventsSubject = (/** @type {?} */ (this.events));
4966
- return /** @type {?} */ ((transitions.pipe(filter(t => t.id !== 0),
5015
+ const eventsSubject = ((/** @type {?} */ (this.events)));
5016
+ return (/** @type {?} */ ((/** @type {?} */ (transitions.pipe(filter(t => t.id !== 0),
4967
5017
  // Extract URL
4968
- map(t => (/** @type {?} */ (Object.assign({}, t, { extractedUrl: this.urlHandlingStrategy.extract(t.rawUrl) })))),
5018
+ map(t => ((/** @type {?} */ (Object.assign({}, t, { extractedUrl: this.urlHandlingStrategy.extract(t.rawUrl) }))))),
4969
5019
  // Using switchMap so we cancel executing navigations when a new one comes in
4970
5020
  switchMap(t => {
4971
5021
  /** @type {?} */
@@ -5003,7 +5053,7 @@ class Router {
5003
5053
  // Fire RoutesRecognized
5004
5054
  tap(t => {
5005
5055
  /** @type {?} */
5006
- const routesRecognized = new RoutesRecognized(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), /** @type {?} */ ((t.targetSnapshot)));
5056
+ const routesRecognized = new RoutesRecognized(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), (/** @type {?} */ (t.targetSnapshot)));
5007
5057
  eventsSubject.next(routesRecognized);
5008
5058
  }));
5009
5059
  }
@@ -5012,8 +5062,8 @@ class Router {
5012
5062
  const processPreviousUrl = urlTransition && this.rawUrlTree &&
5013
5063
  this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree);
5014
5064
  /* When the current URL shouldn't be processed, but the previous one was, we
5015
- * handle this "error condition" by navigating to the previously successful URL,
5016
- * but leaving the URL intact.*/
5065
+ * handle this "error condition" by navigating to the previously successful URL,
5066
+ * but leaving the URL intact.*/
5017
5067
  if (processPreviousUrl) {
5018
5068
  const { id, extractedUrl, source, state, extras } = t;
5019
5069
  /** @type {?} */
@@ -5025,9 +5075,9 @@ class Router {
5025
5075
  }
5026
5076
  else {
5027
5077
  /* When neither the current or previous URL can be processed, do nothing other
5028
- * than update router's internal reference to the current "settled" URL. This
5029
- * way the next navigation will be coming from the current URL in the browser.
5030
- */
5078
+ * than update router's internal reference to the current "settled" URL. This
5079
+ * way the next navigation will be coming from the current URL in the browser.
5080
+ */
5031
5081
  this.rawUrlTree = t.rawUrl;
5032
5082
  t.resolve(null);
5033
5083
  return EMPTY;
@@ -5037,7 +5087,7 @@ class Router {
5037
5087
  // Before Preactivation
5038
5088
  switchTap(t => {
5039
5089
  const { targetSnapshot, id: navigationId, extractedUrl: appliedUrlTree, rawUrl: rawUrlTree, extras: { skipLocationChange, replaceUrl } } = t;
5040
- return this.hooks.beforePreactivation(/** @type {?} */ ((targetSnapshot)), {
5090
+ return this.hooks.beforePreactivation((/** @type {?} */ (targetSnapshot)), {
5041
5091
  navigationId,
5042
5092
  appliedUrlTree,
5043
5093
  rawUrlTree,
@@ -5048,9 +5098,9 @@ class Router {
5048
5098
  // --- GUARDS ---
5049
5099
  tap(t => {
5050
5100
  /** @type {?} */
5051
- const guardsStart = new GuardsCheckStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), /** @type {?} */ ((t.targetSnapshot)));
5101
+ const guardsStart = new GuardsCheckStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), (/** @type {?} */ (t.targetSnapshot)));
5052
5102
  this.triggerEvent(guardsStart);
5053
- }), map(t => (Object.assign({}, t, { guards: getAllRouteGuards(/** @type {?} */ ((t.targetSnapshot)), t.currentSnapshot, this.rootContexts) }))), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), tap(t => {
5103
+ }), map(t => (Object.assign({}, t, { guards: getAllRouteGuards((/** @type {?} */ (t.targetSnapshot)), t.currentSnapshot, this.rootContexts) }))), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), tap(t => {
5054
5104
  if (isUrlTree(t.guardsResult)) {
5055
5105
  /** @type {?} */
5056
5106
  const error = navigationCancelingError(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);
@@ -5059,7 +5109,7 @@ class Router {
5059
5109
  }
5060
5110
  }), tap(t => {
5061
5111
  /** @type {?} */
5062
- const guardsEnd = new GuardsCheckEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), /** @type {?} */ ((t.targetSnapshot)), !!t.guardsResult);
5112
+ const guardsEnd = new GuardsCheckEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), (/** @type {?} */ (t.targetSnapshot)), !!t.guardsResult);
5063
5113
  this.triggerEvent(guardsEnd);
5064
5114
  }), filter(t => {
5065
5115
  if (!t.guardsResult) {
@@ -5077,13 +5127,12 @@ class Router {
5077
5127
  if (t.guards.canActivateChecks.length) {
5078
5128
  return of(t).pipe(tap(t => {
5079
5129
  /** @type {?} */
5080
- const resolveStart = new ResolveStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), /** @type {?} */ ((t.targetSnapshot)));
5130
+ const resolveStart = new ResolveStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), (/** @type {?} */ (t.targetSnapshot)));
5081
5131
  this.triggerEvent(resolveStart);
5082
5132
  }), resolveData(this.paramsInheritanceStrategy, this.ngModule.injector), //
5083
- //
5084
5133
  tap(t => {
5085
5134
  /** @type {?} */
5086
- const resolveEnd = new ResolveEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), /** @type {?} */ ((t.targetSnapshot)));
5135
+ const resolveEnd = new ResolveEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), (/** @type {?} */ (t.targetSnapshot)));
5087
5136
  this.triggerEvent(resolveEnd);
5088
5137
  }));
5089
5138
  }
@@ -5092,7 +5141,7 @@ class Router {
5092
5141
  // --- AFTER PREACTIVATION ---
5093
5142
  switchTap(t => {
5094
5143
  const { targetSnapshot, id: navigationId, extractedUrl: appliedUrlTree, rawUrl: rawUrlTree, extras: { skipLocationChange, replaceUrl } } = t;
5095
- return this.hooks.afterPreactivation(/** @type {?} */ ((targetSnapshot)), {
5144
+ return this.hooks.afterPreactivation((/** @type {?} */ (targetSnapshot)), {
5096
5145
  navigationId,
5097
5146
  appliedUrlTree,
5098
5147
  rawUrlTree,
@@ -5101,34 +5150,33 @@ class Router {
5101
5150
  });
5102
5151
  }), map(t => {
5103
5152
  /** @type {?} */
5104
- const targetRouterState = createRouterState(this.routeReuseStrategy, /** @type {?} */ ((t.targetSnapshot)), t.currentRouterState);
5153
+ const targetRouterState = createRouterState(this.routeReuseStrategy, (/** @type {?} */ (t.targetSnapshot)), t.currentRouterState);
5105
5154
  return (Object.assign({}, t, { targetRouterState }));
5106
- }), /* Once here, we are about to activate syncronously. The assumption is this will
5107
- succeed, and user code may read from the Router service. Therefore before
5108
- activation, we need to update router properties storing the current URL and the
5109
- RouterState, as well as updated the browser URL. All this should happen *before*
5110
- activating. */
5155
+ }),
5156
+ /* Once here, we are about to activate syncronously. The assumption is this will
5157
+ succeed, and user code may read from the Router service. Therefore before
5158
+ activation, we need to update router properties storing the current URL and the
5159
+ RouterState, as well as updated the browser URL. All this should happen *before*
5160
+ activating. */
5111
5161
  tap(t => {
5112
5162
  this.currentUrlTree = t.urlAfterRedirects;
5113
5163
  this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl);
5114
- (/** @type {?} */ (this)).routerState = /** @type {?} */ ((t.targetRouterState));
5164
+ ((/** @type {?} */ (this))).routerState = (/** @type {?} */ (t.targetRouterState));
5115
5165
  if (this.urlUpdateStrategy === 'deferred' && !t.extras.skipLocationChange) {
5116
5166
  this.setBrowserUrl(this.rawUrlTree, !!t.extras.replaceUrl, t.id);
5117
5167
  }
5118
- }), activateRoutes(this.rootContexts, this.routeReuseStrategy, (evt) => this.triggerEvent(evt)), tap({
5119
- /**
5168
+ }), activateRoutes(this.rootContexts, this.routeReuseStrategy, (evt) => this.triggerEvent(evt)), tap({ /**
5120
5169
  * @return {?}
5121
5170
  */
5122
5171
  next() { completed = true; }, /**
5123
5172
  * @return {?}
5124
5173
  */
5125
- complete() { completed = true; }
5126
- }), finalize(() => {
5174
+ complete() { completed = true; } }), finalize(() => {
5127
5175
  /* When the navigation stream finishes either through error or success, we set the
5128
- * `completed` or `errored` flag. However, there are some situations where we could
5129
- * get here without either of those being set. For instance, a redirect during
5130
- * NavigationStart. Therefore, this is a catch-all to make sure the NavigationCancel
5131
- * event is fired when a navigation gets cancelled but not caught by other means. */
5176
+ * `completed` or `errored` flag. However, there are some situations where we could
5177
+ * get here without either of those being set. For instance, a redirect during
5178
+ * NavigationStart. Therefore, this is a catch-all to make sure the NavigationCancel
5179
+ * event is fired when a navigation gets cancelled but not caught by other means. */
5132
5180
  if (!completed && !errored) {
5133
5181
  // Must reset to current URL tree here to ensure history.state is set. On a fresh
5134
5182
  // page load, if a new navigation comes in before a successful navigation
@@ -5145,7 +5193,7 @@ class Router {
5145
5193
  }), catchError((e) => {
5146
5194
  errored = true;
5147
5195
  /* This error type is issued during Redirect, and is handled as a cancellation
5148
- * rather than an error. */
5196
+ * rather than an error. */
5149
5197
  if (isNavigationCancelingError(e)) {
5150
5198
  this.navigated = true;
5151
5199
  /** @type {?} */
@@ -5161,7 +5209,7 @@ class Router {
5161
5209
  this.navigateByUrl(e.url);
5162
5210
  }
5163
5211
  /* All other errors should reset to the router's internal URL reference to the
5164
- * pre-error state. */
5212
+ * pre-error state. */
5165
5213
  }
5166
5214
  else {
5167
5215
  this.resetStateAndUrl(t.currentRouterState, t.currentUrlTree, t.rawUrl);
@@ -5178,7 +5226,7 @@ class Router {
5178
5226
  return EMPTY;
5179
5227
  }));
5180
5228
  // TODO(jasonaden): remove cast once g3 is on updated TypeScript
5181
- }))));
5229
+ }))))));
5182
5230
  }
5183
5231
  /**
5184
5232
  * \@internal
@@ -5222,7 +5270,7 @@ class Router {
5222
5270
  // already patch onPopState, so location change callback will
5223
5271
  // run into ngZone
5224
5272
  if (!this.locationSubscription) {
5225
- this.locationSubscription = /** @type {?} */ (this.location.subscribe((change) => {
5273
+ this.locationSubscription = (/** @type {?} */ (this.location.subscribe((change) => {
5226
5274
  /** @type {?} */
5227
5275
  let rawUrlTree = this.parseUrl(change['url']);
5228
5276
  /** @type {?} */
@@ -5232,7 +5280,7 @@ class Router {
5232
5280
  { navigationId: change.state.navigationId } :
5233
5281
  null;
5234
5282
  setTimeout(() => { this.scheduleNavigation(rawUrlTree, source, state, { replaceUrl: true }); }, 0);
5235
- }));
5283
+ })));
5236
5284
  }
5237
5285
  }
5238
5286
  /**
@@ -5245,7 +5293,7 @@ class Router {
5245
5293
  * @param {?} event
5246
5294
  * @return {?}
5247
5295
  */
5248
- triggerEvent(event) { (/** @type {?} */ (this.events)).next(event); }
5296
+ triggerEvent(event) { ((/** @type {?} */ (this.events))).next(event); }
5249
5297
  /**
5250
5298
  * Resets the configuration used for navigation and generating links.
5251
5299
  *
@@ -5282,7 +5330,7 @@ class Router {
5282
5330
  dispose() {
5283
5331
  if (this.locationSubscription) {
5284
5332
  this.locationSubscription.unsubscribe();
5285
- this.locationSubscription = /** @type {?} */ ((null));
5333
+ this.locationSubscription = (/** @type {?} */ (null));
5286
5334
  }
5287
5335
  }
5288
5336
  /**
@@ -5333,7 +5381,7 @@ class Router {
5333
5381
  */
5334
5382
  createUrlTree(commands, navigationExtras = {}) {
5335
5383
  const { relativeTo, queryParams, fragment, preserveQueryParams, queryParamsHandling, preserveFragment } = navigationExtras;
5336
- if (isDevMode() && preserveQueryParams && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {
5384
+ if (isDevMode() && preserveQueryParams && (/** @type {?} */ (console)) && (/** @type {?} */ (console.warn))) {
5337
5385
  console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');
5338
5386
  }
5339
5387
  /** @type {?} */
@@ -5360,7 +5408,7 @@ class Router {
5360
5408
  if (q !== null) {
5361
5409
  q = this.removeEmptyProps(q);
5362
5410
  }
5363
- return createUrlTree(a, this.currentUrlTree, commands, /** @type {?} */ ((q)), /** @type {?} */ ((f)));
5411
+ return createUrlTree(a, this.currentUrlTree, commands, (/** @type {?} */ (q)), (/** @type {?} */ (f)));
5364
5412
  }
5365
5413
  /**
5366
5414
  * Navigate based on the provided url. This navigation is always absolute.
@@ -5487,7 +5535,7 @@ class Router {
5487
5535
  this.navigations.subscribe(t => {
5488
5536
  this.navigated = true;
5489
5537
  this.lastSuccessfulId = t.id;
5490
- (/** @type {?} */ (this.events))
5538
+ ((/** @type {?} */ (this.events)))
5491
5539
  .next(new NavigationEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));
5492
5540
  t.resolve(true);
5493
5541
  }, e => { this.console.warn(`Unhandled Navigation Error: `); });
@@ -5570,7 +5618,7 @@ class Router {
5570
5618
  * @return {?}
5571
5619
  */
5572
5620
  resetStateAndUrl(storedState, storedUrl, rawUrl) {
5573
- (/** @type {?} */ (this)).routerState = storedState;
5621
+ ((/** @type {?} */ (this))).routerState = storedState;
5574
5622
  this.currentUrlTree = storedUrl;
5575
5623
  this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);
5576
5624
  this.resetUrlToCurrentUrlTree();
@@ -5598,7 +5646,7 @@ function validateCommands(commands) {
5598
5646
 
5599
5647
  /**
5600
5648
  * @fileoverview added by tsickle
5601
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
5649
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
5602
5650
  */
5603
5651
  /**
5604
5652
  * \@description
@@ -5707,7 +5755,7 @@ class RouterLink {
5707
5755
  * @return {?}
5708
5756
  */
5709
5757
  set preserveQueryParams(value) {
5710
- if (isDevMode() && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {
5758
+ if (isDevMode() && (/** @type {?} */ (console)) && (/** @type {?} */ (console.warn))) {
5711
5759
  console.warn('preserveQueryParams is deprecated!, use queryParamsHandling instead.');
5712
5760
  }
5713
5761
  this.preserve = value;
@@ -5805,7 +5853,7 @@ class RouterLinkWithHref {
5805
5853
  * @return {?}
5806
5854
  */
5807
5855
  set preserveQueryParams(value) {
5808
- if (isDevMode() && /** @type {?} */ (console) && /** @type {?} */ (console.warn)) {
5856
+ if (isDevMode() && (/** @type {?} */ (console)) && (/** @type {?} */ (console.warn))) {
5809
5857
  console.warn('preserveQueryParams is deprecated, use queryParamsHandling instead.');
5810
5858
  }
5811
5859
  this.preserve = value;
@@ -5893,7 +5941,7 @@ function attrBoolValue(s) {
5893
5941
 
5894
5942
  /**
5895
5943
  * @fileoverview added by tsickle
5896
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
5944
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
5897
5945
  */
5898
5946
  /**
5899
5947
  *
@@ -6009,7 +6057,7 @@ class RouterLinkActive {
6009
6057
  /** @type {?} */
6010
6058
  const hasActiveLinks = this.hasActiveLinks();
6011
6059
  if (this.isActive !== hasActiveLinks) {
6012
- (/** @type {?} */ (this)).isActive = hasActiveLinks;
6060
+ ((/** @type {?} */ (this))).isActive = hasActiveLinks;
6013
6061
  this.classes.forEach((c) => {
6014
6062
  if (hasActiveLinks) {
6015
6063
  this.renderer.addClass(this.element.nativeElement, c);
@@ -6058,7 +6106,7 @@ RouterLinkActive.propDecorators = {
6058
6106
 
6059
6107
  /**
6060
6108
  * @fileoverview added by tsickle
6061
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
6109
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
6062
6110
  */
6063
6111
  /**
6064
6112
  * @license
@@ -6088,6 +6136,7 @@ class OutletContext {
6088
6136
  */
6089
6137
  class ChildrenOutletContexts {
6090
6138
  constructor() {
6139
+ // contexts for child outlets, by name.
6091
6140
  this.contexts = new Map();
6092
6141
  }
6093
6142
  /**
@@ -6154,7 +6203,7 @@ class ChildrenOutletContexts {
6154
6203
 
6155
6204
  /**
6156
6205
  * @fileoverview added by tsickle
6157
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
6206
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
6158
6207
  */
6159
6208
  /**
6160
6209
  * \@description
@@ -6208,6 +6257,8 @@ class RouterOutlet {
6208
6257
  */
6209
6258
  ngOnInit() {
6210
6259
  if (!this.activated) {
6260
+ // If the outlet was not instantiated at the time the route got activated we need to populate
6261
+ // the outlet when it is initialized (ie inside a NgIf)
6211
6262
  /** @type {?} */
6212
6263
  const context = this.parentContexts.getContext(this.name);
6213
6264
  if (context && context.route) {
@@ -6240,7 +6291,7 @@ class RouterOutlet {
6240
6291
  get activatedRoute() {
6241
6292
  if (!this.activated)
6242
6293
  throw new Error('Outlet is not activated');
6243
- return /** @type {?} */ (this._activatedRoute);
6294
+ return (/** @type {?} */ (this._activatedRoute));
6244
6295
  }
6245
6296
  /**
6246
6297
  * @return {?}
@@ -6302,7 +6353,7 @@ class RouterOutlet {
6302
6353
  /** @type {?} */
6303
6354
  const snapshot = activatedRoute._futureSnapshot;
6304
6355
  /** @type {?} */
6305
- const component = /** @type {?} */ (/** @type {?} */ ((snapshot.routeConfig)).component);
6356
+ const component = (/** @type {?} */ ((/** @type {?} */ (snapshot.routeConfig)).component));
6306
6357
  resolver = resolver || this.resolver;
6307
6358
  /** @type {?} */
6308
6359
  const factory = resolver.resolveComponentFactory(component);
@@ -6361,7 +6412,7 @@ class OutletInjector {
6361
6412
 
6362
6413
  /**
6363
6414
  * @fileoverview added by tsickle
6364
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
6415
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
6365
6416
  */
6366
6417
  /**
6367
6418
  * \@description
@@ -6458,6 +6509,9 @@ class RouterPreloader {
6458
6509
  const ngModule = this.injector.get(NgModuleRef);
6459
6510
  return this.processRoutes(ngModule, this.router.config);
6460
6511
  }
6512
+ // TODO(jasonaden): This class relies on code external to the class to call setUpPreloading. If
6513
+ // this hasn't been done, ngOnDestroy will fail as this.subscription will be undefined. This
6514
+ // should be refactored.
6461
6515
  /**
6462
6516
  * @return {?}
6463
6517
  */
@@ -6518,7 +6572,7 @@ RouterPreloader.ctorParameters = () => [
6518
6572
 
6519
6573
  /**
6520
6574
  * @fileoverview added by tsickle
6521
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
6575
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
6522
6576
  */
6523
6577
  class RouterScroller {
6524
6578
  /**
@@ -6618,27 +6672,30 @@ class RouterScroller {
6618
6672
 
6619
6673
  /**
6620
6674
  * @fileoverview added by tsickle
6621
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
6675
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
6622
6676
  */
6623
- /** *
6677
+ /**
6624
6678
  * \@description
6625
6679
  *
6626
6680
  * Contains a list of directives
6627
6681
  *
6628
6682
  *
6629
- @type {?} */
6683
+ * @type {?}
6684
+ */
6630
6685
  const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, EmptyOutletComponent];
6631
- /** *
6686
+ /**
6632
6687
  * \@description
6633
6688
  *
6634
6689
  * Is used in DI to configure the router.
6635
6690
  *
6636
6691
  * \@publicApi
6637
- @type {?} */
6692
+ * @type {?}
6693
+ */
6638
6694
  const ROUTER_CONFIGURATION = new InjectionToken('ROUTER_CONFIGURATION');
6639
- /** *
6695
+ /**
6640
6696
  * \@docsNotRequired
6641
- @type {?} */
6697
+ * @type {?}
6698
+ */
6642
6699
  const ROUTER_FORROOT_GUARD = new InjectionToken('ROUTER_FORROOT_GUARD');
6643
6700
  /** @type {?} */
6644
6701
  const ROUTER_PROVIDERS = [
@@ -6719,6 +6776,7 @@ function routerNgProbeToken() {
6719
6776
  * \@publicApi
6720
6777
  */
6721
6778
  class RouterModule {
6779
+ // Note: We are injecting the Router so it gets created eagerly...
6722
6780
  /**
6723
6781
  * @param {?} guard
6724
6782
  * @param {?} router
@@ -6944,7 +7002,7 @@ class RouterInitializer {
6944
7002
  const p = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
6945
7003
  return p.then(() => {
6946
7004
  /** @type {?} */
6947
- let resolve = /** @type {?} */ ((null));
7005
+ let resolve = (/** @type {?} */ (null));
6948
7006
  /** @type {?} */
6949
7007
  const res = new Promise(r => resolve = r);
6950
7008
  /** @type {?} */
@@ -6968,7 +7026,7 @@ class RouterInitializer {
6968
7026
  // subsequent navigations should not be delayed
6969
7027
  }
6970
7028
  else {
6971
- return /** @type {?} */ (of(null));
7029
+ return (/** @type {?} */ (of(null)));
6972
7030
  }
6973
7031
  };
6974
7032
  router.initialNavigation();
@@ -7006,7 +7064,7 @@ class RouterInitializer {
7006
7064
  preloader.setUpPreloading();
7007
7065
  routerScroller.init();
7008
7066
  router.resetRootComponentType(ref.componentTypes[0]);
7009
- this.resultOfPreactivationDone.next(/** @type {?} */ ((null)));
7067
+ this.resultOfPreactivationDone.next((/** @type {?} */ (null)));
7010
7068
  this.resultOfPreactivationDone.complete();
7011
7069
  }
7012
7070
  /**
@@ -7046,11 +7104,12 @@ function getAppInitializer(r) {
7046
7104
  function getBootstrapListener(r) {
7047
7105
  return r.bootstrapListener.bind(r);
7048
7106
  }
7049
- /** *
7107
+ /**
7050
7108
  * A token for the router initializer that will be called after the app is bootstrapped.
7051
7109
  *
7052
7110
  * \@publicApi
7053
- @type {?} */
7111
+ * @type {?}
7112
+ */
7054
7113
  const ROUTER_INITIALIZER = new InjectionToken('Router Initializer');
7055
7114
  /**
7056
7115
  * @return {?}
@@ -7071,32 +7130,32 @@ function provideRouterInitializer() {
7071
7130
 
7072
7131
  /**
7073
7132
  * @fileoverview added by tsickle
7074
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
7133
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
7075
7134
  */
7076
- /** *
7135
+ /**
7077
7136
  * \@publicApi
7078
- @type {?} */
7079
- const VERSION = new Version('7.1.3');
7137
+ * @type {?}
7138
+ */
7139
+ const VERSION = new Version('7.1.4');
7080
7140
 
7081
7141
  /**
7082
7142
  * @fileoverview added by tsickle
7083
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
7143
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
7084
7144
  */
7085
7145
 
7086
7146
  /**
7087
7147
  * @fileoverview added by tsickle
7088
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
7148
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
7089
7149
  */
7090
7150
 
7091
7151
  /**
7092
7152
  * @fileoverview added by tsickle
7093
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
7153
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
7094
7154
  */
7095
- // This file only reexports content of the `src` folder. Keep it that way.
7096
7155
 
7097
7156
  /**
7098
7157
  * @fileoverview added by tsickle
7099
- * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
7158
+ * @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
7100
7159
  */
7101
7160
 
7102
7161
  /**