@angular/router 7.2.8 → 7.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v7.2.8
2
+ * @license Angular v7.2.12
3
3
  * (c) 2010-2019 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v7.2.8
2
+ * @license Angular v7.2.12
3
3
  * (c) 2010-2019 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/fesm5/router.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v7.2.8
2
+ * @license Angular v7.2.12
3
3
  * (c) 2010-2019 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -3680,9 +3680,10 @@ function defaultRouterHook(snapshot, runExtras) {
3680
3680
  /**
3681
3681
  * @description
3682
3682
  *
3683
- * Provides the navigation and url manipulation capabilities.
3683
+ * An NgModule that provides navigation and URL manipulation capabilities.
3684
3684
  *
3685
- * See `Routes` for more details and examples.
3685
+ * @see `Route`.
3686
+ * @see [Routing and Navigation Guide](guide/router).
3686
3687
  *
3687
3688
  * @ngModule RouterModule
3688
3689
  *
@@ -3704,11 +3705,12 @@ var Router = /** @class */ (function () {
3704
3705
  this.currentNavigation = null;
3705
3706
  this.navigationId = 0;
3706
3707
  this.isNgZoneEnabled = false;
3708
+ /**
3709
+ * An event stream for routing events in this NgModule.
3710
+ */
3707
3711
  this.events = new Subject();
3708
3712
  /**
3709
- * Error handler that is invoked when a navigation errors.
3710
- *
3711
- * See `ErrorHandler` for more information.
3713
+ * A handler for navigation errors in this NgModule.
3712
3714
  */
3713
3715
  this.errorHandler = defaultErrorHandler;
3714
3716
  /**
@@ -3718,13 +3720,16 @@ var Router = /** @class */ (function () {
3718
3720
  */
3719
3721
  this.malformedUriErrorHandler = defaultMalformedUriErrorHandler;
3720
3722
  /**
3721
- * Indicates if at least one navigation happened.
3723
+ * True if at least one navigation event has occurred,
3724
+ * false otherwise.
3722
3725
  */
3723
3726
  this.navigated = false;
3724
3727
  this.lastSuccessfulId = -1;
3725
3728
  /**
3726
- * Used by RouterModule. This allows us to
3727
- * pause the navigation either before preactivation or after it.
3729
+ * Hooks that enable you to pause navigation,
3730
+ * either before or after the preactivation phase.
3731
+ * Used by `RouterModule`.
3732
+ *
3728
3733
  * @internal
3729
3734
  */
3730
3735
  this.hooks = {
@@ -3735,21 +3740,24 @@ var Router = /** @class */ (function () {
3735
3740
  * Extracts and merges URLs. Used for AngularJS to Angular migrations.
3736
3741
  */
3737
3742
  this.urlHandlingStrategy = new DefaultUrlHandlingStrategy();
3743
+ /**
3744
+ * The strategy for re-using routes.
3745
+ */
3738
3746
  this.routeReuseStrategy = new DefaultRouteReuseStrategy();
3739
3747
  /**
3740
- * Define what the router should do if it receives a navigation request to the current URL.
3741
- * By default, the router will ignore this navigation. However, this prevents features such
3742
- * as a "refresh" button. Use this option to configure the behavior when navigating to the
3743
- * current URL. Default is 'ignore'.
3748
+ * How to handle a navigation request to the current URL. One of:
3749
+ * - `'ignore'` : The router ignores the request.
3750
+ * - `'reload'` : The router reloads the URL. Use to implement a "refresh" feature.
3744
3751
  */
3745
3752
  this.onSameUrlNavigation = 'ignore';
3746
3753
  /**
3747
- * Defines how the router merges params, data and resolved data from parent to child
3748
- * routes. Available options are:
3754
+ * How to merge parameters, data, and resolved data from parent to child
3755
+ * routes. One of:
3749
3756
  *
3750
- * - `'emptyOnly'`, the default, only inherits parent params for path-less or component-less
3751
- * routes.
3752
- * - `'always'`, enables unconditional inheritance of parent params.
3757
+ * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
3758
+ * for path-less or component-less routes.
3759
+ * - `'always'` : Inherit parent parameters, data, and resolved data
3760
+ * for all child routes.
3753
3761
  */
3754
3762
  this.paramsInheritanceStrategy = 'emptyOnly';
3755
3763
  /**
@@ -3808,23 +3816,23 @@ var Router = /** @class */ (function () {
3808
3816
  return transitions.pipe(filter(function (t) { return t.id !== 0; }),
3809
3817
  // Extract URL
3810
3818
  map(function (t) { return (__assign({}, t, { extractedUrl: _this.urlHandlingStrategy.extract(t.rawUrl) })); }),
3811
- // Store the Navigation object
3812
- tap(function (t) {
3813
- _this.currentNavigation = {
3814
- id: t.id,
3815
- initialUrl: t.currentRawUrl,
3816
- extractedUrl: t.extractedUrl,
3817
- trigger: t.source,
3818
- extras: t.extras,
3819
- previousNavigation: _this.lastSuccessfulNavigation ? __assign({}, _this.lastSuccessfulNavigation, { previousNavigation: null }) :
3820
- null
3821
- };
3822
- }),
3823
3819
  // Using switchMap so we cancel executing navigations when a new one comes in
3824
3820
  switchMap(function (t) {
3825
3821
  var completed = false;
3826
3822
  var errored = false;
3827
- return of(t).pipe(switchMap(function (t) {
3823
+ return of(t).pipe(
3824
+ // Store the Navigation object
3825
+ tap(function (t) {
3826
+ _this.currentNavigation = {
3827
+ id: t.id,
3828
+ initialUrl: t.currentRawUrl,
3829
+ extractedUrl: t.extractedUrl,
3830
+ trigger: t.source,
3831
+ extras: t.extras,
3832
+ previousNavigation: _this.lastSuccessfulNavigation ? __assign({}, _this.lastSuccessfulNavigation, { previousNavigation: null }) :
3833
+ null
3834
+ };
3835
+ }), switchMap(function (t) {
3828
3836
  var urlTransition = !_this.navigated || t.extractedUrl.toString() !== _this.browserUrlTree.toString();
3829
3837
  var processCurrentUrl = (_this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
3830
3838
  _this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);
@@ -4071,7 +4079,7 @@ var Router = /** @class */ (function () {
4071
4079
  }
4072
4080
  };
4073
4081
  Object.defineProperty(Router.prototype, "url", {
4074
- /** The current url */
4082
+ /** The current URL. */
4075
4083
  get: function () { return this.serializeUrl(this.currentUrlTree); },
4076
4084
  enumerable: true,
4077
4085
  configurable: true
@@ -4083,9 +4091,9 @@ var Router = /** @class */ (function () {
4083
4091
  /**
4084
4092
  * Resets the configuration used for navigation and generating links.
4085
4093
  *
4086
- * @usageNotes
4094
+ * @param config The route array for the new configuration.
4087
4095
  *
4088
- * ### Example
4096
+ * @usageNotes
4089
4097
  *
4090
4098
  * ```
4091
4099
  * router.resetConfig([
@@ -4104,7 +4112,7 @@ var Router = /** @class */ (function () {
4104
4112
  };
4105
4113
  /** @docsNotRequired */
4106
4114
  Router.prototype.ngOnDestroy = function () { this.dispose(); };
4107
- /** Disposes of the router */
4115
+ /** Disposes of the router. */
4108
4116
  Router.prototype.dispose = function () {
4109
4117
  if (this.locationSubscription) {
4110
4118
  this.locationSubscription.unsubscribe();
@@ -4112,14 +4120,16 @@ var Router = /** @class */ (function () {
4112
4120
  }
4113
4121
  };
4114
4122
  /**
4115
- * Applies an array of commands to the current url tree and creates a new url tree.
4123
+ * Applies an array of commands to the current URL tree and creates a new URL tree.
4116
4124
  *
4117
4125
  * When given an activate route, applies the given commands starting from the route.
4118
4126
  * When not given a route, applies the given command starting from the root.
4119
4127
  *
4120
- * @usageNotes
4128
+ * @param commands An array of commands to apply.
4129
+ * @param navigationExtras
4130
+ * @returns The new URL tree.
4121
4131
  *
4122
- * ### Example
4132
+ * @usageNotes
4123
4133
  *
4124
4134
  * ```
4125
4135
  * // create /team/33/user/11
@@ -4184,12 +4194,15 @@ var Router = /** @class */ (function () {
4184
4194
  return createUrlTree(a, this.currentUrlTree, commands, q, f);
4185
4195
  };
4186
4196
  /**
4187
- * Navigate based on the provided url. This navigation is always absolute.
4197
+ * Navigate based on the provided URL, which must be absolute.
4188
4198
  *
4189
- * Returns a promise that:
4190
- * - resolves to 'true' when navigation succeeds,
4191
- * - resolves to 'false' when navigation fails,
4192
- * - is rejected when an error happens.
4199
+ * @param url An absolute URL. The function does not apply any delta to the current URL.
4200
+ * @param extras An object containing properties that modify the navigation strategy.
4201
+ * The function ignores any properties in the `NavigationExtras` that would change the
4202
+ * provided URL.
4203
+ *
4204
+ * @returns A Promise that resolves to 'true' when navigation succeeds,
4205
+ * to 'false' when navigation fails, or is rejected on error.
4193
4206
  *
4194
4207
  * @usageNotes
4195
4208
  *
@@ -4202,10 +4215,6 @@ var Router = /** @class */ (function () {
4202
4215
  * router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });
4203
4216
  * ```
4204
4217
  *
4205
- * Since `navigateByUrl()` takes an absolute URL as the first parameter,
4206
- * it will not apply any delta to the current URL and ignores any properties
4207
- * in the second parameter (the `NavigationExtras`) that would change the
4208
- * provided URL.
4209
4218
  */
4210
4219
  Router.prototype.navigateByUrl = function (url, extras) {
4211
4220
  if (extras === void 0) { extras = { skipLocationChange: false }; }
@@ -5717,7 +5726,7 @@ function provideRouterInitializer() {
5717
5726
  /**
5718
5727
  * @publicApi
5719
5728
  */
5720
- var VERSION = new Version('7.2.8');
5729
+ var VERSION = new Version('7.2.12');
5721
5730
 
5722
5731
  /**
5723
5732
  * @license